mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-12-26 06:15:16 +00:00
Make nesting levels work. Obviously ++nestdepth does not do in python
what it does in C++. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@15930 a592a061-630c-0410-9148-cb99ea01b6c8
This commit is contained in:
parent
0735a7bcdc
commit
f71a169294
@ -350,9 +350,6 @@ def convert_commandparams(document):
|
||||
# \begin_inset LatexCommand bibitem was not the official version (see
|
||||
# convert_bibitem()), but could be read in, so we convert it here, too.
|
||||
|
||||
# FIXME: Handle things like \command[foo[bar]]{foo{bar}}
|
||||
# we need a real parser here.
|
||||
regex = re.compile(r'\\([^\[\{]+)(\[[^\[\{]*\])?(\[[^\[\{]*\])?(\{[^}]*\})?')
|
||||
i = 0
|
||||
while 1:
|
||||
i = find_token(document.body, "\\begin_inset LatexCommand", i)
|
||||
@ -384,11 +381,11 @@ def convert_commandparams(document):
|
||||
if nestdepth == 0:
|
||||
state = "WS"
|
||||
else:
|
||||
--nestdepth
|
||||
nestdepth = nestdepth - 1
|
||||
if ((state == "OPTION" and c == '[') or
|
||||
(state == "SECOPTION" and c == '[') or
|
||||
(state == "CONTENT" and c == '{')):
|
||||
++nestdepth
|
||||
nestdepth = nestdepth + 1
|
||||
if state == "CMDNAME":
|
||||
name += c
|
||||
elif state == "OPTION":
|
||||
|
Loading…
Reference in New Issue
Block a user