Repository: executablebooks/MyST-Parser
Pull request #505 (2022-01-14 10:55:30)

‼️ BREAKING: Remove dollarmath from default `myst_enable_extensions`
Also, the `tex2jax_ignore mathjax_ignore` classes are only added to the document if the `dollarmath` extension is enabled.
Similarly, the mathjax configuration is only overriden if the `dollarmath` extension is enabled.

### References

- Discussed in #399
- Some steps in this direction made in #385


codecov[bot]: # [Codecov](https://codecov.io/gh/executablebooks/MyST-Parser/pull/505?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks) Report
> Merging [#505](https://codecov.io/gh/executablebooks/MyST-Parser/pull/505?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks) (a5b3985) into [master](https://codecov.io/gh/executablebooks/MyST-Parser/commit/ad6e39d30cdb0f96333e066ea9c6eb812c6aa034?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks) (ad6e39d) will **decrease** coverage by `0.10%`.
> The diff coverage is `100.00%`.

[![Impacted file tree graph](https://codecov.io/gh/executablebooks/MyST-Parser/pull/505/graphs/tree.svg?width=650&height=150&src=pr&token=ggpNnuB7ll&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks)](https://codecov.io/gh/executablebooks/MyST-Parser/pull/505?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks)

```diff
@@            Coverage Diff             @@
##           master     #505      +/-   ##
==========================================
- Coverage   89.88%   89.77%   -0.11%     
==========================================
  Files          16       16              
  Lines        2095     2103       +8     
==========================================
+ Hits         1883     1888       +5     
- Misses        212      215       +3     
```

| Flag | Coverage Δ | |
|---|---|---|
| pytests | `89.77% <100.00%> (-0.11%)` | :arrow_down: |

Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#carryforward-flags-in-the-pull-request-comment) to find out more.

| [Impacted Files](https://codecov.io/gh/executablebooks/MyST-Parser/pull/505?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks) | Coverage Δ | |
|---|---|---|
| [myst\_parser/main.py](https://codecov.io/gh/executablebooks/MyST-Parser/pull/505/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#diff-bXlzdF9wYXJzZXIvbWFpbi5weQ==) | `90.97% <ø> (+2.25%)` | :arrow_up: |
| [myst\_parser/sphinx\_renderer.py](https://codecov.io/gh/executablebooks/MyST-Parser/pull/505/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#diff-bXlzdF9wYXJzZXIvc3BoaW54X3JlbmRlcmVyLnB5) | `93.14% <ø> (ø)` | |
| [myst\_parser/docutils\_renderer.py](https://codecov.io/gh/executablebooks/MyST-Parser/pull/505/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#diff-bXlzdF9wYXJzZXIvZG9jdXRpbHNfcmVuZGVyZXIucHk=) | `91.78% <100.00%> (+0.06%)` | :arrow_up: |
| [myst\_parser/mathjax.py](https://codecov.io/gh/executablebooks/MyST-Parser/pull/505/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks#diff-bXlzdF9wYXJzZXIvbWF0aGpheC5weQ==) | `83.33% <100.00%> (-12.32%)` | :arrow_down: |

------

[Continue to review full report at Codecov](https://codecov.io/gh/executablebooks/MyST-Parser/pull/505?src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks).
> **Legend** - [Click here to learn more](https://docs.codecov.io/docs/codecov-delta?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks)
> `Δ = absolute <relative> (impact)`, `ø = not affected`, `? = missing data`
> Powered by [Codecov](https://codecov.io/gh/executablebooks/MyST-Parser/pull/505?src=pr&el=footer&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks). Last update [ad6e39d...a5b3985](https://codecov.io/gh/executablebooks/MyST-Parser/pull/505?src=pr&el=lastupdated&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks). Read the [comment docs](https://docs.codecov.io/docs/pull-request-comments?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=executablebooks).

mmcky: @chrisjsewell @choldgraf -- sorry for my slow response, was on the road yesterday for 13 hours so offline. This is a really useful syntax for a lot of authors. I don't mind if it get's removed from `myst-parser` for `stability` reasons. However (as you say) I would recommend we leave it enabled it by default for `jupyter-book`. 👍 
chrisjsewell: > Did we have any of these discussions in a public space that we could cross reference?

Yes this also was already discussed in #399, and you essentially already made part of this change in #385

> I guess this means that we are changing the "core MyST spec" 

dollarmath had already been moved to the optional syntax docs page in #385, so this is essentially already the case.

> Does this mean that the recommended way for MyST Markdown to parse math is via a `{math}` directive?

This, in part, depends on what level of compatibility you want with "native" Jupyter Notebooks.
`{math}` obviously does not "degrade" as gracefully as using `$` math, in this context.

It is kind of annoying that both sphinx and jupyter load mathjax by default, whose default configuration then "aggressively" converts all `$` in the HTML to math.
This kind of gives the false impression that dollarmath is being directly supported by MyST, even if not enabled, and obviously the mathjax approach does not support non-HTML output formats
(up-front `$` identification in the Markdown parser, is most definitely the better solution, which is what the `dollarmath` extension does)

> I would recommend we leave it enabled it by default for jupyter-book

It does not affect jupyter-book, which "hard-codes" the default MyST extensions enabled
chrisjsewell: > Thanks for digging up those links. I've updated the top comment with refs to those issues - just wanted to follow best practices to link back to conversations about stuff.

cheers

> If Jupyter moved away from marked.js and towards markdown-it, I wonder if this could be handled more gracefully by using a dollarmath extension in markdown-it, that would then render the right syntax for MathJax to process 🤔

Yep exactly; the "problem" at present, it that MathJax is acting as both a parser and a renderer,
Ideally, all the parsing (i.e. syntax tokenization) should be performed by the Markdown parser, then it just utliises mathjax/katex to turn the LaTeX into HTML. 

For example, this is what https://github.com/executablebooks/markdown-it-dollarmath does

On the "python side", even more ideal, would be that you had a python implementation of mathjax/katex. Then the static HTML you generate would already have the math in HTML, and you wouldn't need to be running "dynamic" JavaScript.
This is essentially what happens with code blocks, that get converted to HTML by https://pygments.org/ during the sphinx/docutils build


Patch:
diff --git a/docs/syntax/optional.md b/docs/syntax/optional.md
index 605e9fe..5b5de4d 100644
--- a/docs/syntax/optional.md
+++ b/docs/syntax/optional.md
@@ -95,8 +95,8 @@ and you will neeed to suppress the `myst.strikethrough` warning
 
 Math is parsed by adding to the `myst_enable_extensions` list option, in the sphinx `conf.py` [configuration file](https://www.sphinx-doc.org/en/master/usage/configuration.html) one or both of:
 
-- `"dollarmath"` (added by default) for parsing of dollar `$` and `$$` encapsulated math.
-- `"amsmath"` (off by default) for direct parsing of [amsmath LaTeX environments](https://ctan.org/pkg/amsmath).
+- `"dollarmath"` for parsing of dollar `$` and `$$` encapsulated math.
+- `"amsmath"` for direct parsing of [amsmath LaTeX environments](https://ctan.org/pkg/amsmath).
 
 These options enable their respective Markdown parser plugins, as detailed in the [markdown-it plugin guide](markdown_it:md/plugins).
 
@@ -106,7 +106,7 @@ These options enable their respective Markdown parser plugins, as detailed in th
 
 ### Dollar delimited math
 
-Enabling dollar math will parse the following syntax:
+Enabling `dollarmath` will parse the following syntax:
 
 - Inline math: `$...$`
 - Display (block) math: `$$...$$`
@@ -235,7 +235,7 @@ See [the extended syntax option](syntax/amsmath).
 ### Mathjax and math parsing
 
 When building HTML using the [sphinx.ext.mathjax](https://www.sphinx-doc.org/en/master/usage/extensions/math.html#module-sphinx.ext.mathjax) extension (enabled by default),
-Myst-Parser injects the `tex2jax_ignore` (MathJax v2) and  `mathjax_ignore` (MathJax v3) classes in to the top-level section of each MyST document, and adds the following default MathJax configuration:
+If `dollarmath` is enabled, Myst-Parser injects the `tex2jax_ignore` (MathJax v2) and  `mathjax_ignore` (MathJax v3) classes in to the top-level section of each MyST document, and adds the following default MathJax configuration:
 
 MathJax version 2 (see [the tex2jax preprocessor](https://docs.mathjax.org/en/v2.7-latest/options/preprocessors/tex2jax.html#configure-tex2jax):
 
diff --git a/docs/syntax/syntax.md b/docs/syntax/syntax.md
index 36adea9..7311cf6 100644
--- a/docs/syntax/syntax.md
+++ b/docs/syntax/syntax.md
@@ -368,9 +368,6 @@ header-rows: 1
 * - Type
   - MyST
   - reStructuredText
-* - Math shortcuts
-  - `$x^2$`
-  - N/A
 * - Front matter
   - ```md
     ---
diff --git a/myst_parser/docutils_renderer.py b/myst_parser/docutils_renderer.py
index 66aabe8..4494b54 100644
--- a/myst_parser/docutils_renderer.py
+++ b/myst_parser/docutils_renderer.py
@@ -595,10 +595,12 @@ class DocutilsRenderer(RendererProtocol):
 
     @property
     def blocks_mathjax_processing(self) -> bool:
-        """Only add mathjax ignore classes if using sphinx and myst_update_mathjax is True."""
+        """Only add mathjax ignore classes if using sphinx,
+        and using the ``dollarmath`` extension, and ``myst_update_mathjax=True``.
+        """
         return (
             self.sphinx_env is not None
-            and "myst_update_mathjax" in self.sphinx_env.config
+            and "dollarmath" in self.md_config.enable_extensions
             and self.md_config.update_mathjax
         )
 
@@ -985,6 +987,17 @@ class DocutilsRenderer(RendererProtocol):
         self.add_line_and_source_path(node, token)
         self.current_node.append(node)
 
+    def render_amsmath(self, token: SyntaxTreeNode) -> None:
+        # note docutils does not currently support the nowrap attribute
+        # or equation numbering, so this is overridden in the sphinx renderer
+        node = nodes.math_block(
+            token.content, token.content, nowrap=True, classes=["amsmath"]
+        )
+        if token.meta["numbered"] != "*":
+            node["numbered"] = True
+        self.add_line_and_source_path(node, token)
+        self.current_node.append(node)
+
     def render_footnote_ref(self, token: SyntaxTreeNode) -> None:
         """Footnote references are added as auto-numbered,
         .i.e. `[^a]` is read as rST `[#a]_`
diff --git a/myst_parser/main.py b/myst_parser/main.py
index 508c110..c26c7ed 100644
--- a/myst_parser/main.py
+++ b/myst_parser/main.py
@@ -49,7 +49,7 @@ class MdParserConfig:
         metadata={"help": "Use strict Github Flavoured Markdown parser"},
     )
     enable_extensions: Sequence[str] = attr.ib(
-        factory=lambda: ["dollarmath"], metadata={"help": "Enable extensions"}
+        factory=list, metadata={"help": "Enable extensions"}
     )
 
     linkify_fuzzy_links: bool = attr.ib(
diff --git a/myst_parser/mathjax.py b/myst_parser/mathjax.py
index 85a62af..c108434 100644
--- a/myst_parser/mathjax.py
+++ b/myst_parser/mathjax.py
@@ -51,6 +51,8 @@ def override_mathjax(app: Sphinx):
             None,
         )
 
+    if "dollarmath" not in app.config["myst_enable_extensions"]:
+        return
     if not app.env.myst_config.update_mathjax:  # type: ignore[attr-defined]
         return
 
diff --git a/myst_parser/sphinx_renderer.py b/myst_parser/sphinx_renderer.py
index 5b3a175..f5b3192 100644
--- a/myst_parser/sphinx_renderer.py
+++ b/myst_parser/sphinx_renderer.py
@@ -186,6 +186,7 @@ class SphinxRenderer(DocutilsRenderer):
         return str(uuid4())
 
     def render_amsmath(self, token: SyntaxTreeNode) -> None:
+        """Renderer for the amsmath extension."""
         # environment = token.meta["environment"]
         content = token.content
 
diff --git a/setup.cfg b/setup.cfg
index 92d22a7..2da3d5e 100644
--- a/setup.cfg
+++ b/setup.cfg
@@ -79,7 +79,7 @@ testing =
     pytest>=6,<7
     pytest-cov
     pytest-regressions
-    pytest-param-files~=0.3.3
+    pytest-param-files~=0.3.4
 
 [flake8]
 max-line-length = 100


Test patch:
diff --git a/tests/test_renderers/fixtures/docutil_syntax_elements.md b/tests/test_renderers/fixtures/docutil_syntax_elements.md
index 91add67..9371803 100644
--- a/tests/test_renderers/fixtures/docutil_syntax_elements.md
+++ b/tests/test_renderers/fixtures/docutil_syntax_elements.md
@@ -307,56 +307,6 @@ Nested Enumrated List:
                         c
 .
 
---------------------------
-Inline Math:
-.
-$foo$
-.
-<document source="notset">
-    <paragraph>
-        <math>
-            foo
-.
-
---------------------------
-Inline Math, multi-line:
-.
-a $foo
-bar$ b
-.
-<document source="notset">
-    <paragraph>
-        a
-        <math>
-            foo
-            bar
-         b
-.
-
---------------------------
-Inline Math, multi-line with line break (invalid):
-.
-a $foo
-
-bar$ b
-.
-<document source="notset">
-    <paragraph>
-        a $foo
-    <paragraph>
-        bar$ b
-.
-
---------------------------
-Math Block:
-.
-$$foo$$
-.
-<document source="notset">
-    <math_block nowrap="False" number="True" xml:space="preserve">
-        foo
-.
-
 --------------------------
 Sphinx Role containing backtick:
 .
diff --git a/tests/test_renderers/fixtures/docutil_syntax_extensions.txt b/tests/test_renderers/fixtures/docutil_syntax_extensions.txt
new file mode 100644
index 0000000..5efcb68
--- /dev/null
+++ b/tests/test_renderers/fixtures/docutil_syntax_extensions.txt
@@ -0,0 +1,139 @@
+[dollarmath] --myst-enable-extensions=dollarmath
+.
+$foo$
+
+a $foo
+bar$ b
+
+$$foo$$
+
+$$
+a = 1
+$$
+.
+<document source="<string>">
+    <paragraph>
+        <math>
+            foo
+    <paragraph>
+        a
+        <math>
+            foo
+            bar
+         b
+    <math_block nowrap="False" number="True" xml:space="preserve">
+        foo
+    <math_block nowrap="False" number="True" xml:space="preserve">
+
+        a = 1
+.
+
+[amsmath] --myst-enable-extensions=amsmath
+.
+\begin{equation} a \end{equation}
+
+\begin{equation}
+a
+\end{equation}
+
+\begin{equation*}
+a
+\end{equation*}
+.
+<document source="<string>">
+    <math_block classes="amsmath" nowrap="True" numbered="True" xml:space="preserve">
+        \begin{equation} a \end{equation}
+    <math_block classes="amsmath" nowrap="True" numbered="True" xml:space="preserve">
+        \begin{equation}
+        a
+        \end{equation}
+    <math_block classes="amsmath" nowrap="True" xml:space="preserve">
+        \begin{equation*}
+        a
+        \end{equation*}
+.
+
+[deflist] --myst-enable-extensions=deflist
+.
+term
+: definition
+.
+<document source="<string>">
+    <definition_list classes="simple myst">
+        <definition_list_item>
+            <term>
+                term
+            <definition>
+                <paragraph>
+                    definition
+.
+
+[fieldlist] --myst-enable-extensions=fieldlist
+.
+:name: value
+.
+<document source="<string>">
+    <docinfo>
+        <field classes="name">
+            <field_name>
+                name
+            <field_body>
+                <paragraph>
+                    value
+.
+
+[colon_fence] --myst-enable-extensions=colon_fence
+.
+:::{note}
+content
+:::
+.
+<document source="<string>">
+    <note>
+        <paragraph>
+            content
+.
+
+[replacements] --myst-enable-extensions=replacements
+.
+(c) (C) (r) (R) (tm) (TM) (p) (P) +- ...
+.
+<document source="<string>">
+    <paragraph>
+        © © ® ® ™ ™ § § ± …
+.
+
+[strikethrough] --myst-enable-extensions=strikethrough
+.
+~~foo~~
+.
+<document source="<string>">
+    <paragraph>
+        <system_message level="2" line="1" source="<string>" type="WARNING">
+            <paragraph>
+                Strikethrough is currently only supported in HTML output [myst.strikethrough]
+        <raw format="html" xml:space="preserve">
+            

+        foo
+        <raw format="html" xml:space="preserve">
+            

+.
+
+[tasklist] --myst-enable-extensions=tasklist
+.
+- [ ] foo
+- [x] bar
+.
+<document source="<string>">
+    <bullet_list bullet="-" classes="contains-task-list">
+        <list_item classes="task-list-item">
+            <paragraph>
+                <raw format="html" xml:space="preserve">
+                    <input class="task-list-item-checkbox" disabled="disabled" type="checkbox">
+                 foo
+        <list_item classes="task-list-item">
+            <paragraph>
+                <raw format="html" xml:space="preserve">
+                    <input class="task-list-item-checkbox" checked="checked" disabled="disabled" type="checkbox">
+                 bar
+.
diff --git a/tests/test_renderers/fixtures/dollarmath.md b/tests/test_renderers/fixtures/dollarmath.md
new file mode 100644
index 0000000..d3acabc
--- /dev/null
+++ b/tests/test_renderers/fixtures/dollarmath.md
@@ -0,0 +1,81 @@
+--------------------------
+Inline Math:
+.
+$foo$
+.
+<document source="notset">
+    <paragraph>
+        <math>
+            foo
+.
+
+--------------------------
+Inline Math, multi-line:
+.
+a $foo
+bar$ b
+.
+<document source="notset">
+    <paragraph>
+        a
+        <math>
+            foo
+            bar
+         b
+.
+
+--------------------------
+Inline Math, multi-line with line break (invalid):
+.
+a $foo
+
+bar$ b
+.
+<document source="notset">
+    <paragraph>
+        a $foo
+    <paragraph>
+        bar$ b
+.
+
+--------------------------
+Math Block:
+.
+$$foo$$
+.
+<document source="notset">
+    <math_block nowrap="False" number="True" xml:space="preserve">
+        foo
+.
+
+--------------------------
+Math Block With Equation Label:
+.
+$$foo$$ (abc)
+.
+<document source="notset">
+    <target ids="equation-abc">
+    <math_block docname="mock_docname" label="abc" nowrap="False" number="1" xml:space="preserve">
+        foo
+.
+
+--------------------------
+Math Block multiple:
+.
+$$
+a = 1
+$$
+
+$$
+b = 2
+$$ (a)
+.
+<document source="notset">
+    <math_block nowrap="False" number="True" xml:space="preserve">
+
+        a = 1
+    <target ids="equation-a">
+    <math_block docname="mock_docname" label="a" nowrap="False" number="1" xml:space="preserve">
+
+        b = 2
+.
diff --git a/tests/test_renderers/fixtures/sphinx_syntax_elements.md b/tests/test_renderers/fixtures/sphinx_syntax_elements.md
index 0e8cf34..d706780 100644
--- a/tests/test_renderers/fixtures/sphinx_syntax_elements.md
+++ b/tests/test_renderers/fixtures/sphinx_syntax_elements.md
@@ -307,88 +307,6 @@ Nested Enumrated List:
                         c
 .
 
---------------------------
-Inline Math:
-.
-$foo$
-.
-<document source="notset">
-    <paragraph>
-        <math>
-            foo
-.
-
---------------------------
-Inline Math, multi-line:
-.
-a $foo
-bar$ b
-.
-<document source="notset">
-    <paragraph>
-        a
-        <math>
-            foo
-            bar
-         b
-.
-
---------------------------
-Inline Math, multi-line with line break (invalid):
-.
-a $foo
-
-bar$ b
-.
-<document source="notset">
-    <paragraph>
-        a $foo
-    <paragraph>
-        bar$ b
-.
-
---------------------------
-Math Block:
-.
-$$foo$$
-.
-<document source="notset">
-    <math_block nowrap="False" number="True" xml:space="preserve">
-        foo
-.
-
---------------------------
-Math Block With Equation Label:
-.
-$$foo$$ (abc)
-.
-<document source="notset">
-    <target ids="equation-abc">
-    <math_block docname="mock_docname" label="abc" nowrap="False" number="1" xml:space="preserve">
-        foo
-.
-
---------------------------
-Math Block multiple:
-.
-$$
-a = 1
-$$
-
-$$
-b = 2
-$$ (a)
-.
-<document source="notset">
-    <math_block nowrap="False" number="True" xml:space="preserve">
-
-        a = 1
-    <target ids="equation-a">
-    <math_block docname="mock_docname" label="a" nowrap="False" number="1" xml:space="preserve">
-
-        b = 2
-.
-
 --------------------------
 Sphinx Role containing backtick:
 .
diff --git a/tests/test_renderers/fixtures/tables.md b/tests/test_renderers/fixtures/tables.md
index fe0e39b..65238d3 100644
--- a/tests/test_renderers/fixtures/tables.md
+++ b/tests/test_renderers/fixtures/tables.md
@@ -91,7 +91,7 @@ Nested syntax:
 .
 | *a* | __*b*__  |
 | --- | -------- |
-|$1$  | {sub}`x` |
+|c  | {sub}`x` |
 .
 <document source="notset">
     <table classes="colwidths-auto">
@@ -113,8 +113,7 @@ Nested syntax:
                 <row>
                     <entry>
                         <paragraph>
-                            <math>
-                                1
+                            c
                     <entry>
                         <paragraph>
                             <subscript>
diff --git a/tests/test_renderers/test_fixtures_docutils.py b/tests/test_renderers/test_fixtures_docutils.py
index 96b5a29..b1897b1 100644
--- a/tests/test_renderers/test_fixtures_docutils.py
+++ b/tests/test_renderers/test_fixtures_docutils.py
@@ -2,10 +2,14 @@
 
 Note, the output AST is before any transforms are applied.
 """
+import shlex
+from io import StringIO
 from pathlib import Path
 
 import pytest
+from docutils.core import Publisher, publish_doctree
 
+from myst_parser.docutils_ import Parser
 from myst_parser.docutils_renderer import DocutilsRenderer, make_document
 from myst_parser.main import MdParserConfig, create_md_parser
 
@@ -42,3 +46,26 @@ def test_docutils_directives(file_params):
     parser.options["document"] = document = make_document()
     parser.render(file_params.content)
     file_params.assert_expected(document.pformat(), rstrip_lines=True)
+
+
+@pytest.mark.param_file(FIXTURE_PATH / "docutil_syntax_extensions.txt")
+def test_syntax_extensions(file_params):
+    """The description is parsed as a docutils commandline"""
+    pub = Publisher(parser=Parser())
+    option_parser = pub.setup_option_parser()
+    try:
+        settings = option_parser.parse_args(
+            shlex.split(file_params.description)
+        ).__dict__
+    except Exception as err:
+        raise AssertionError(
+            f"Failed to parse commandline: {file_params.description}\n{err}"
+        )
+    report_stream = StringIO()
+    settings["warning_stream"] = report_stream
+    doctree = publish_doctree(
+        file_params.content,
+        parser=Parser(),
+        settings_overrides=settings,
+    )
+    file_params.assert_expected(doctree.pformat(), rstrip_lines=True)
diff --git a/tests/test_renderers/test_fixtures_sphinx.py b/tests/test_renderers/test_fixtures_sphinx.py
index 9a09d12..06a3885 100644
--- a/tests/test_renderers/test_fixtures_sphinx.py
+++ b/tests/test_renderers/test_fixtures_sphinx.py
@@ -64,6 +64,16 @@ def test_sphinx_roles(file_params):
     file_params.assert_expected(actual, rstrip_lines=True)
 
 
+@pytest.mark.param_file(FIXTURE_PATH / "dollarmath.md")
+def test_dollarmath(file_params, monkeypatch):
+    document = to_docutils(
+        file_params.content,
+        MdParserConfig(enable_extensions=["dollarmath"]),
+        in_sphinx_env=True,
+    )
+    file_params.assert_expected(document.pformat(), rstrip_lines=True)
+
+
 @pytest.mark.param_file(FIXTURE_PATH / "amsmath.md")
 def test_amsmath(file_params, monkeypatch):
     monkeypatch.setattr(SphinxRenderer, "_random_label", lambda self: "mock-uuid")
diff --git a/tests/test_renderers/test_myst_refs/duplicate.xml b/tests/test_renderers/test_myst_refs/duplicate.xml
index 3bd850d..35d4e8d 100644
--- a/tests/test_renderers/test_myst_refs/duplicate.xml
+++ b/tests/test_renderers/test_myst_refs/duplicate.xml
@@ -1,4 +1,4 @@
-<document classes="tex2jax_ignore mathjax_ignore" ids="title index" names="title index" source="root/index.md" title="Title">
+<document ids="title index" names="title index" source="root/index.md" title="Title">
     <title>
         Title
     <target refid="index">
diff --git a/tests/test_renderers/test_myst_refs/ref.xml b/tests/test_renderers/test_myst_refs/ref.xml
index dad992c..78e2a49 100644
--- a/tests/test_renderers/test_myst_refs/ref.xml
+++ b/tests/test_renderers/test_myst_refs/ref.xml
@@ -1,4 +1,4 @@
-<document classes="tex2jax_ignore mathjax_ignore" ids="title ref" names="title ref" source="root/index.md" title="Title">
+<document ids="title ref" names="title ref" source="root/index.md" title="Title">
     <title>
         Title
     <target refid="ref">
diff --git a/tests/test_renderers/test_myst_refs/ref_colon.xml b/tests/test_renderers/test_myst_refs/ref_colon.xml
index 128e0c3..affccd4 100644
--- a/tests/test_renderers/test_myst_refs/ref_colon.xml
+++ b/tests/test_renderers/test_myst_refs/ref_colon.xml
@@ -1,4 +1,4 @@
-<document classes="tex2jax_ignore mathjax_ignore" ids="title ref-colon" names="title ref:colon" source="root/index.md" title="Title">
+<document ids="title ref-colon" names="title ref:colon" source="root/index.md" title="Title">
     <title>
         Title
     <target refid="ref-colon">
diff --git a/tests/test_renderers/test_myst_refs/ref_nested.xml b/tests/test_renderers/test_myst_refs/ref_nested.xml
index 8b989e9..34f99c8 100644
--- a/tests/test_renderers/test_myst_refs/ref_nested.xml
+++ b/tests/test_renderers/test_myst_refs/ref_nested.xml
@@ -1,4 +1,4 @@
-<document classes="tex2jax_ignore mathjax_ignore" ids="title ref" names="title ref" source="root/index.md" title="Title">
+<document ids="title ref" names="title ref" source="root/index.md" title="Title">
     <title>
         Title
     <target refid="ref">
diff --git a/tests/test_sphinx/test_sphinx_builds.py b/tests/test_sphinx/test_sphinx_builds.py
index 351f6b7..c25e17b 100644
--- a/tests/test_sphinx/test_sphinx_builds.py
+++ b/tests/test_sphinx/test_sphinx_builds.py
@@ -18,7 +18,10 @@ SOURCE_DIR = os.path.abspath(os.path.join(os.path.dirname(__file__), "sourcedirs
 
 
 @pytest.mark.sphinx(
-    buildername="html", srcdir=os.path.join(SOURCE_DIR, "basic"), freshenv=True
+    buildername="html",
+    srcdir=os.path.join(SOURCE_DIR, "basic"),
+    freshenv=True,
+    confoverrides={"myst_enable_extensions": ["dollarmath"]},
 )
 def test_basic(
     app,
@@ -75,6 +78,7 @@ def test_basic(
     buildername="html",
     srcdir=os.path.join(SOURCE_DIR, "references"),
     freshenv=True,
+    confoverrides={"myst_enable_extensions": ["dollarmath"]},
 )
 def test_references(
     app,
@@ -483,7 +487,10 @@ def test_gettext_additional_targets(
 
 
 @pytest.mark.sphinx(
-    buildername="html", srcdir=os.path.join(SOURCE_DIR, "mathjax"), freshenv=True
+    buildername="html",
+    srcdir=os.path.join(SOURCE_DIR, "mathjax"),
+    freshenv=True,
+    confoverrides={"myst_enable_extensions": ["dollarmath"]},
 )
 def test_mathjax_warning(
     app,
diff --git a/tests/test_sphinx/test_sphinx_builds/test_commonmark_only.sphinx3.html b/tests/test_sphinx/test_sphinx_builds/test_commonmark_only.sphinx3.html
index 3bc468c..b6d79f6 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_commonmark_only.sphinx3.html
+++ b/tests/test_sphinx/test_sphinx_builds/test_commonmark_only.sphinx3.html
@@ -1,7 +1,7 @@
 <div class="documentwrapper">
  <div class="bodywrapper">
   <div class="body" role="main">
-   <div class="tex2jax_ignore mathjax_ignore section" id="test">
+   <div class="section" id="test">
     <h1>
      Test
      <a class="headerlink" href="#test" title="Permalink to this headline">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_commonmark_only.sphinx4.html b/tests/test_sphinx/test_sphinx_builds/test_commonmark_only.sphinx4.html
index 52f631e..294bc66 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_commonmark_only.sphinx4.html
+++ b/tests/test_sphinx/test_sphinx_builds/test_commonmark_only.sphinx4.html
@@ -1,7 +1,7 @@
 <div class="documentwrapper">
  <div class="bodywrapper">
   <div class="body" role="main">
-   <section class="tex2jax_ignore mathjax_ignore" id="test">
+   <section id="test">
     <h1>
      Test
      <a class="headerlink" href="#test" title="Permalink to this headline">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_commonmark_only.xml b/tests/test_sphinx/test_sphinx_builds/test_commonmark_only.xml
index 40e4553..d685466 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_commonmark_only.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_commonmark_only.xml
@@ -1,5 +1,5 @@
 <document source="index.md">
-    <section classes="tex2jax_ignore mathjax_ignore" ids="test" names="test">
+    <section ids="test" names="test">
         <title>
             Test
         <literal_block language="{note}" xml:space="preserve">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx3.html b/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx3.html
index 44f950a..0d29ed8 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx3.html
+++ b/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx3.html
@@ -1,7 +1,7 @@
 <div class="documentwrapper">
  <div class="bodywrapper">
   <div class="body" role="main">
-   <div class="tex2jax_ignore mathjax_ignore section" id="test">
+   <div class="section" id="test">
     <h1>
      Test
      <a class="headerlink" href="#test" title="Permalink to this headline">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx3.xml b/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx3.xml
index 5860669..d6a886f 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx3.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx3.xml
@@ -1,5 +1,5 @@
 <document source="index.md">
-    <section classes="tex2jax_ignore mathjax_ignore" ids="test" names="test">
+    <section ids="test" names="test">
         <title>
             Test
         <field_list classes="myst">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx4.html b/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx4.html
index a4213a7..bef86e9 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx4.html
+++ b/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx4.html
@@ -1,7 +1,7 @@
 <div class="documentwrapper">
  <div class="bodywrapper">
   <div class="body" role="main">
-   <section class="tex2jax_ignore mathjax_ignore" id="test">
+   <section id="test">
     <h1>
      Test
      <a class="headerlink" href="#test" title="Permalink to this headline">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx4.xml b/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx4.xml
index 7da41c1..60b8a19 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx4.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_fieldlist_extension.sphinx4.xml
@@ -1,5 +1,5 @@
 <document source="index.md">
-    <section classes="tex2jax_ignore mathjax_ignore" ids="test" names="test">
+    <section ids="test" names="test">
         <title>
             Test
         <field_list classes="myst">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_footnotes.sphinx3.html b/tests/test_sphinx/test_sphinx_builds/test_footnotes.sphinx3.html
index 51b7a1d..fb0714c 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_footnotes.sphinx3.html
+++ b/tests/test_sphinx/test_sphinx_builds/test_footnotes.sphinx3.html
@@ -1,7 +1,7 @@
 <div class="documentwrapper">
  <div class="bodywrapper">
   <div class="body" role="main">
-   <div class="tex2jax_ignore mathjax_ignore section" id="footnotes-with-markdown">
+   <div class="section" id="footnotes-with-markdown">
     <h1>
      Footnotes with Markdown
      <a class="headerlink" href="#footnotes-with-markdown" title="Permalink to this headline">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_footnotes.sphinx4.html b/tests/test_sphinx/test_sphinx_builds/test_footnotes.sphinx4.html
index 4c6ae19..70cfb54 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_footnotes.sphinx4.html
+++ b/tests/test_sphinx/test_sphinx_builds/test_footnotes.sphinx4.html
@@ -1,7 +1,7 @@
 <div class="documentwrapper">
  <div class="bodywrapper">
   <div class="body" role="main">
-   <section class="tex2jax_ignore mathjax_ignore" id="footnotes-with-markdown">
+   <section id="footnotes-with-markdown">
     <h1>
      Footnotes with Markdown
      <a class="headerlink" href="#footnotes-with-markdown" title="Permalink to this headline">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_footnotes.xml b/tests/test_sphinx/test_sphinx_builds/test_footnotes.xml
index e64efc2..950d4f8 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_footnotes.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_footnotes.xml
@@ -1,5 +1,5 @@
 <document source="footnote_md.md">
-    <section classes="tex2jax_ignore mathjax_ignore" ids="footnotes-with-markdown" names="footnotes\ with\ markdown">
+    <section ids="footnotes-with-markdown" names="footnotes\ with\ markdown">
         <title>
             Footnotes with Markdown
         <paragraph>
diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx3.xml b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx3.xml
index 9a742cc..8d9866e 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx3.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx3.xml
@@ -1,5 +1,5 @@
 <document source="index.md">
-    <section classes="tex2jax_ignore mathjax_ignore" ids="bold-text-1" names="bold\ text\ 1 texte\ 1\ en\ gras">
+    <section ids="bold-text-1" names="bold\ text\ 1 texte\ 1\ en\ gras">
         <title>
             texte 1 en 
             <strong>
diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx4.xml b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx4.xml
index 636a2e8..1b1c195 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx4.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.resolved.sphinx4.xml
@@ -1,5 +1,5 @@
 <document source="index.md">
-    <section classes="tex2jax_ignore mathjax_ignore" ids="bold-text-1" names="bold\ text\ 1 texte\ 1\ en\ gras">
+    <section ids="bold-text-1" names="bold\ text\ 1 texte\ 1\ en\ gras">
         <title>
             texte 1 en 
             <strong>
diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx3.html b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx3.html
index 26425e9..1c1f861 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx3.html
+++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx3.html
@@ -1,7 +1,7 @@
 <div class="documentwrapper">
  <div class="bodywrapper">
   <div class="body" role="main">
-   <div class="tex2jax_ignore mathjax_ignore section" id="bold-text-1">
+   <div class="section" id="bold-text-1">
     <h1>
      texte 1 en
      <strong>
diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx3.xml b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx3.xml
index a39fabe..ef749eb 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx3.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx3.xml
@@ -1,5 +1,5 @@
 <document source="index.md">
-    <section classes="tex2jax_ignore mathjax_ignore" ids="bold-text-1" names="bold\ text\ 1 texte\ 1\ en\ gras">
+    <section ids="bold-text-1" names="bold\ text\ 1 texte\ 1\ en\ gras">
         <title>
             texte 1 en 
             <strong>
diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.html b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.html
index adad986..825048a 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.html
+++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.html
@@ -1,7 +1,7 @@
 <div class="documentwrapper">
  <div class="bodywrapper">
   <div class="body" role="main">
-   <section class="tex2jax_ignore mathjax_ignore" id="bold-text-1">
+   <section id="bold-text-1">
     <h1>
      texte 1 en
      <strong>
diff --git a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.xml b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.xml
index 9fddb48..0d8dbc7 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_gettext_html.sphinx4.xml
@@ -1,5 +1,5 @@
 <document source="index.md">
-    <section classes="tex2jax_ignore mathjax_ignore" ids="bold-text-1" names="bold\ text\ 1 texte\ 1\ en\ gras">
+    <section ids="bold-text-1" names="bold\ text\ 1 texte\ 1\ en\ gras">
         <title>
             texte 1 en 
             <strong>
diff --git a/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.resolved.xml b/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.resolved.xml
index 54dc269..e48908d 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.resolved.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.resolved.xml
@@ -1,5 +1,5 @@
 <document source="index.md">
-    <section classes="tex2jax_ignore mathjax_ignore" ids="hyphen-1" myst-anchor="index.md#hyphen-1" names="hyphen\ -\ 1">
+    <section ids="hyphen-1" myst-anchor="index.md#hyphen-1" names="hyphen\ -\ 1">
         <title>
             Hyphen - 1
         <section ids="dot-1-1" myst-anchor="index.md#dot-1-1" names="dot\ 1.1">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.sphinx3.html b/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.sphinx3.html
index 1aa0e1f..cbf5e04 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.sphinx3.html
+++ b/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.sphinx3.html
@@ -1,7 +1,7 @@
 <div class="documentwrapper">
  <div class="bodywrapper">
   <div class="body" role="main">
-   <div class="tex2jax_ignore mathjax_ignore section" id="hyphen-1">
+   <div class="section" id="hyphen-1">
     <h1>
      Hyphen - 1
      <a class="headerlink" href="#hyphen-1" title="Permalink to this headline">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.sphinx4.html b/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.sphinx4.html
index 8418c3e..b3631a0 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.sphinx4.html
+++ b/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.sphinx4.html
@@ -1,7 +1,7 @@
 <div class="documentwrapper">
  <div class="bodywrapper">
   <div class="body" role="main">
-   <section class="tex2jax_ignore mathjax_ignore" id="hyphen-1">
+   <section id="hyphen-1">
     <h1>
      Hyphen - 1
      <a class="headerlink" href="#hyphen-1" title="Permalink to this headline">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.xml b/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.xml
index 54dc269..e48908d 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_heading_slug_func.xml
@@ -1,5 +1,5 @@
 <document source="index.md">
-    <section classes="tex2jax_ignore mathjax_ignore" ids="hyphen-1" myst-anchor="index.md#hyphen-1" names="hyphen\ -\ 1">
+    <section ids="hyphen-1" myst-anchor="index.md#hyphen-1" names="hyphen\ -\ 1">
         <title>
             Hyphen - 1
         <section ids="dot-1-1" myst-anchor="index.md#dot-1-1" names="dot\ 1.1">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_include_from_rst.xml b/tests/test_sphinx/test_sphinx_builds/test_include_from_rst.xml
index 6f32506..9248bd3 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_include_from_rst.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_include_from_rst.xml
@@ -2,7 +2,7 @@
     <section ids="title" names="title">
         <title>
             Title
-        <section classes="tex2jax_ignore mathjax_ignore" ids="markdown" names="markdown">
+        <section ids="markdown" names="markdown">
             <title>
                 Markdown
             <paragraph>
diff --git a/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx3.html b/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx3.html
index 5ce20bb..d3f2232 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx3.html
+++ b/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx3.html
@@ -1,7 +1,7 @@
 <div class="documentwrapper">
  <div class="bodywrapper">
   <div class="body" role="main">
-   <div class="tex2jax_ignore mathjax_ignore section" id="main-title">
+   <div class="section" id="main-title">
     <h1>
      Main Title
      <a class="headerlink" href="#main-title" title="Permalink to this headline">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx3.xml b/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx3.xml
index 55f619c..aee98fe 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx3.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx3.xml
@@ -1,5 +1,5 @@
 <document source="index.md">
-    <section classes="tex2jax_ignore mathjax_ignore" ids="main-title" names="main\ title">
+    <section ids="main-title" names="main\ title">
         <title>
             Main Title
         <target refid="inc-header">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx4.html b/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx4.html
index 4407e06..7866223 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx4.html
+++ b/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx4.html
@@ -1,7 +1,7 @@
 <div class="documentwrapper">
  <div class="bodywrapper">
   <div class="body" role="main">
-   <section class="tex2jax_ignore mathjax_ignore" id="main-title">
+   <section id="main-title">
     <h1>
      Main Title
      <a class="headerlink" href="#main-title" title="Permalink to this headline">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx4.xml b/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx4.xml
index cd66516..1e8779c 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx4.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_includes.sphinx4.xml
@@ -1,5 +1,5 @@
 <document source="index.md">
-    <section classes="tex2jax_ignore mathjax_ignore" ids="main-title" names="main\ title">
+    <section ids="main-title" names="main\ title">
         <title>
             Main Title
         <target refid="inc-header">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.resolved.xml b/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.resolved.xml
index 69862c1..606e769 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.resolved.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.resolved.xml
@@ -1,5 +1,5 @@
 <document source="other.md">
-    <section classes="tex2jax_ignore mathjax_ignore" ids="other-title" myst-anchor="other/other.md#other-title" names="other\ title">
+    <section ids="other-title" myst-anchor="other/other.md#other-title" names="other\ title">
         <title>
             Other Title
         <paragraph>
diff --git a/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.sphinx3.html b/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.sphinx3.html
index 5647594..57f1e15 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.sphinx3.html
+++ b/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.sphinx3.html
@@ -1,7 +1,7 @@
 <div class="documentwrapper">
  <div class="bodywrapper">
   <div class="body" role="main">
-   <div class="tex2jax_ignore mathjax_ignore section" id="title">
+   <div class="section" id="title">
     <h1>
      Title
      <a class="headerlink" href="#title" title="Permalink to this headline">
@@ -11,7 +11,7 @@
     <div class="toctree-wrapper compound">
      <span id="document-other/index">
      </span>
-     <div class="tex2jax_ignore mathjax_ignore section" id="other-index">
+     <div class="section" id="other-index">
       <h2>
        Other Index
        <a class="headerlink" href="#other-index" title="Permalink to this headline">
@@ -21,7 +21,7 @@
       <div class="toctree-wrapper compound">
        <span id="document-other/other">
        </span>
-       <div class="tex2jax_ignore mathjax_ignore section" id="other-title">
+       <div class="section" id="other-title">
         <h3>
          Other Title
          <a class="headerlink" href="#other-title" title="Permalink to this headline">
@@ -59,7 +59,7 @@
        </div>
        <span id="document-other/other2">
        </span>
-       <div class="tex2jax_ignore mathjax_ignore section" id="other-2-title">
+       <div class="section" id="other-2-title">
         <h3>
          Other 2 Title
          <a class="headerlink" href="#other-2-title" title="Permalink to this headline">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.sphinx4.html b/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.sphinx4.html
index 0faa5b7..23ff49f 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.sphinx4.html
+++ b/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.sphinx4.html
@@ -1,7 +1,7 @@
 <div class="documentwrapper">
  <div class="bodywrapper">
   <div class="body" role="main">
-   <section class="tex2jax_ignore mathjax_ignore" id="title">
+   <section id="title">
     <h1>
      Title
      <a class="headerlink" href="#title" title="Permalink to this headline">
@@ -11,7 +11,7 @@
     <div class="toctree-wrapper compound">
      <span id="document-other/index">
      </span>
-     <section class="tex2jax_ignore mathjax_ignore" id="other-index">
+     <section id="other-index">
       <h2>
        Other Index
        <a class="headerlink" href="#other-index" title="Permalink to this headline">
@@ -21,7 +21,7 @@
       <div class="toctree-wrapper compound">
        <span id="document-other/other">
        </span>
-       <section class="tex2jax_ignore mathjax_ignore" id="other-title">
+       <section id="other-title">
         <h3>
          Other Title
          <a class="headerlink" href="#other-title" title="Permalink to this headline">
@@ -59,7 +59,7 @@
        </section>
        <span id="document-other/other2">
        </span>
-       <section class="tex2jax_ignore mathjax_ignore" id="other-2-title">
+       <section id="other-2-title">
         <h3>
          Other 2 Title
          <a class="headerlink" href="#other-2-title" title="Permalink to this headline">
diff --git a/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.xml b/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.xml
index bbbd7c3..a209b4f 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_references_singlehtml.xml
@@ -1,5 +1,5 @@
 <document source="other.md">
-    <section classes="tex2jax_ignore mathjax_ignore" ids="other-title" myst-anchor="other/other.md#other-title" names="other\ title">
+    <section ids="other-title" myst-anchor="other/other.md#other-title" names="other\ title">
         <title>
             Other Title
         <paragraph>
diff --git a/tests/test_sphinx/test_sphinx_builds/test_substitutions.other.xml b/tests/test_sphinx/test_sphinx_builds/test_substitutions.other.xml
index 40a5de0..b8f94f5 100644
--- a/tests/test_sphinx/test_sphinx_builds/test_substitutions.other.xml
+++ b/tests/test_sphinx/test_sphinx_builds/test_substitutions.other.xml
@@ -1,5 +1,5 @@
 <document source="other.md">
-    <section classes="tex2jax_ignore mathjax_ignore" ids="other" names="other">
+    <section ids="other" names="other">
         <title>
             Other
         <paragraph>