Compare commits
No commits in common. "6cfe01ed10e4c214fcf2ceec7704b4bfd52f4834" and "c171e17b90bf900254d43c6d30a358c7bddd9216" have entirely different histories.
6cfe01ed10
...
c171e17b90
@ -367,7 +367,7 @@ def cmd_include(args: str, variables:dict[str, str]={}) -> str:
|
|||||||
cmd_args = match.groups()[1].replace('\t', ' ').strip(' ')
|
cmd_args = match.groups()[1].replace('\t', ' ').strip(' ')
|
||||||
pdebug("cmd_include", f"Found command '{command}' with args '{cmd_args}'")
|
pdebug("cmd_include", f"Found command '{command}' with args '{cmd_args}'")
|
||||||
if command == "section":
|
if command == "section":
|
||||||
if cmd_args == target_section:
|
if cmd_args.startswith(target_section):
|
||||||
p.pos["start"] = max(p.pos["cmt_end"] + len(COMMENT_END), p.pos["line_end"] + 1)
|
p.pos["start"] = max(p.pos["cmt_end"] + len(COMMENT_END), p.pos["line_end"] + 1)
|
||||||
elif p.pos["start"] >= 0: #end
|
elif p.pos["start"] >= 0: #end
|
||||||
p.pos["end"] = max(p.pos["cmt_end"] + len(COMMENT_END), p.pos["line_end"] + 1)
|
p.pos["end"] = max(p.pos["cmt_end"] + len(COMMENT_END), p.pos["line_end"] + 1)
|
||||||
@ -394,8 +394,7 @@ def cmd_include(args: str, variables:dict[str, str]={}) -> str:
|
|||||||
if filename.endswith(".md"):
|
if filename.endswith(".md"):
|
||||||
try:
|
try:
|
||||||
import mdtex2html as m2h # this package also converts tex to MathML
|
import mdtex2html as m2h # this package also converts tex to MathML
|
||||||
# replace #$ to avoid everything being parsed as formula
|
content = m2h.convert(content, extensions=["extra"])
|
||||||
content = m2h.convert(content.replace('\\#$', 'REPLHASHDOLLAR').replace('#$', 'REPLHASHDOLLAR'), extensions=["extra"]).replace('REPLHASHDOLLAR', '#$')
|
|
||||||
except:
|
except:
|
||||||
error("cmd_include", f"mdtex2html could not be imported, falling back to python-markdown for md to html conversion", level=error_levels["light"], exit_code=exit_codes["MarkdownConversionError"])
|
error("cmd_include", f"mdtex2html could not be imported, falling back to python-markdown for md to html conversion", level=error_levels["light"], exit_code=exit_codes["MarkdownConversionError"])
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user