Modernise
This commit is contained in:
parent
4c6441182b
commit
8faee98ec6
44 changed files with 214 additions and 201 deletions
|
|
@ -34,7 +34,6 @@ macros and environments, specifying how they should be parsed by
|
|||
`pylatexenc 2.0`.
|
||||
"""
|
||||
|
||||
|
||||
import sys
|
||||
|
||||
if sys.version_info.major > 2:
|
||||
|
|
@ -154,7 +153,7 @@ class EnvironmentSpec(object):
|
|||
environmentname,
|
||||
args_parser=MacroStandardArgsParser(),
|
||||
is_math_mode=False,
|
||||
**kwargs
|
||||
**kwargs,
|
||||
):
|
||||
super(EnvironmentSpec, self).__init__(**kwargs)
|
||||
self.environmentname = environmentname
|
||||
|
|
@ -776,9 +775,9 @@ class LatexContextDb(object):
|
|||
new_context.add_context_category(
|
||||
cat,
|
||||
macros=self.d[cat]["macros"].values() if keep_macros else [],
|
||||
environments=self.d[cat]["environments"].values()
|
||||
if keep_environments
|
||||
else [],
|
||||
environments=(
|
||||
self.d[cat]["environments"].values() if keep_environments else []
|
||||
),
|
||||
specials=self.d[cat]["specials"].values() if keep_specials else [],
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -296,7 +296,7 @@ class MacroStandardArgsParser(object):
|
|||
|
||||
for j, argt in enumerate(self.argspec):
|
||||
if argt == "{":
|
||||
(node, np, nl) = w.get_latex_expression(
|
||||
node, np, nl = w.get_latex_expression(
|
||||
p, strict_braces=False, parsing_state=get_inner_parsing_state(j)
|
||||
)
|
||||
p = np + nl
|
||||
|
|
@ -315,7 +315,7 @@ class MacroStandardArgsParser(object):
|
|||
if optarginfotuple is None:
|
||||
argnlist.append(None)
|
||||
continue
|
||||
(node, np, nl) = optarginfotuple
|
||||
node, np, nl = optarginfotuple
|
||||
p = np + nl
|
||||
argnlist.append(node)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue