Skip to content

Commit

Permalink
align_with_mathics-core_PR1327
Browse files Browse the repository at this point in the history
  • Loading branch information
mmatera committed Jan 31, 2025
1 parent 173913a commit 70972d2
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion mathics_django/doc/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
HYPERTEXT_RE,
IMG_PNG_RE,
IMG_RE,
LATEX_RE,
LIST_ITEM_RE,
LIST_RE,
MATHICS_RE,
Expand All @@ -28,6 +27,9 @@
)


# This rule is different than the used in LaTeX documentation.
LATEX_RE = re.compile(r"(\s?)\$([A-Za-z]+?)\$(\s?)")

def slugify(value):
"""
Converts to lowercase, removes non-word characters apart from '$',
Expand Down Expand Up @@ -82,6 +84,7 @@ def repl_latex(match):
def repl_mathics(match):
text = match.group(1)
text = text.replace("\\'", "'")
text = text.replace("\\$", "$")
text = text.replace(" ", " ")
if text:
return "<code>%s</code>" % text
Expand Down

0 comments on commit 70972d2

Please sign in to comment.