]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Allow optional arguments to LaTeX macros to span lines. This is legal in
authorFred Drake <fdrake@acm.org>
Fri, 6 Jul 2001 21:01:19 +0000 (21:01 +0000)
committerFred Drake <fdrake@acm.org>
Fri, 6 Jul 2001 21:01:19 +0000 (21:01 +0000)
LaTeX and we have at least one occurance of that in the content, so this
script needs to support it as well.

Doc/tools/sgmlconv/latex2esis.py

index 74e1dc7e12fb5dbbe41ec22c9a4ca98c5be50fc8..e694f5604da010060da1020f2851f51375fa29ce 100755 (executable)
@@ -56,7 +56,7 @@ _end_env_rx = re.compile(r"[\\]end{([^}]*)}")
 _begin_macro_rx = re.compile(r"[\\]([a-zA-Z]+[*]?) ?({|\s*\n?)")
 _comment_rx = re.compile("%+ ?(.*)\n[ \t]*")
 _text_rx = re.compile(r"[^]~%\\{}]+")
-_optional_rx = re.compile(r"\s*[[]([^]]*)[]]")
+_optional_rx = re.compile(r"\s*[[]([^]]*)[]]", re.MULTILINE)
 # _parameter_rx is this complicated to allow {...} inside a parameter;
 # this is useful to match tabular layout specifications like {c|p{24pt}}
 _parameter_rx = re.compile("[ \n]*{(([^{}}]|{[^}]*})*)}")