Welcome to Codidact Meta!
Codidact Meta is the meta-discussion site for the Codidact community network and the Codidact software. Whether you have bug reports or feature requests, support questions or rule discussions that touch the whole network – this is the site for you.
Post History
Allow use of the <math> tag directly Whether we convert MathJax to MathML behind the scenes or not, users should be able to directly add <math> tags to their posts. We currently allow...
#6: Post edited
- ## Allow use of the `<math>` tag directly
- Whether we convert MathJax to MathML behind the scenes or not, users should be able to directly add `<math>` tags to their posts.
- We currently allow both Markdown and HTML in posts. Markdown has the advantages of being quicker to write and easier to read when not rendered (such as during editing). HTML has the advantage of allowing some things that are not possible in Markdown, such as collapsible hidden sections using a `<details>` tag.
- Similarly, I'd like to see both MathJax and MathML allowed in posts. MathJax has the advantages of being quicker to write and easier to read when not rendered. MathML has the advantages of rendering faster and not requiring JavaScript to be enabled.
- ## Communities that do not have MathJax enabled
- - For communities that already have MathJax, I'd like to see MathML available too.
- - For communities that do not have MathJax, I'd still like to see MathML available.
- Unlike MathJax, which slows down page loading and increases data usage due to the extra JavaScript that must be loaded, MathML is built into the browser so enabling it will have no effect on loading time or data usage. I see no reason to have a community-specific switch for MathML. We can simply stop blocking it for all communities, and let the browser handle it automatically.
- ## MathML is straightforward to enable
- No code change is required to allow the use of a `<math>` tag in a post. All that is required is to add 'math' to the list of allowed tags[^1]. I've tested this in my local development environment. Here's a comparison of MathML then MathJax in a post:
- > 
- The first of each pair is MathML, the second is MathJax. In this screenshot they look identical. They look this this in both the editor preview and the saved post. In the live post that I'm viewing locally, the only difference is that if I press refresh the MathJax versions momentarily turn back to raw MathJax, whereas the MathML stays as mathematical notation. The raw MathML never shows, even on a slow connection, in the same way that raw HTML never shows, even on a slow connection.
- <details>
- <summary>The MathML and MathJax used to produce this screenshot</summary>
- ```text
- A fraction inline in the middle of a sentence <math>
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math> as an example.
- A fraction inline in the middle of a sentence $\frac{1+4}{23}$ as an example.
- A fraction on its own line:
- <math display="block">
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math>
- A fraction on its own line:
- $$\frac{1+4}{23}$$
- ```
- </details>
- [^1]: To be useful, we'd also need the tags that are used inside a `<math>` tag, such as `<mn>`, `<mo>`, `<mfrac>`, `<mrow>`, but this is still just a matter of adding them to the list of allowed tags. To allow mathematical notation on its own line (rather than inline in a sentence) we'd also need to add 'display' to the list of allowed attributes, to allow `<math display="block">`, but that's the full extent of the changes I needed to make to get this working in my local development environment - simply adding names to 2 lists.
- ## Allow use of the `<math>` tag directly
- Whether we convert MathJax to MathML behind the scenes or not, users should be able to directly add `<math>` tags to their posts.
- We currently allow both Markdown and HTML in posts. Markdown has the advantages of being quicker to write and easier to read when not rendered (such as during editing). HTML has the advantage of allowing some things that are not possible in Markdown, such as collapsible hidden sections using a `<details>` tag.
- Similarly, I'd like to see both MathJax and MathML allowed in posts. MathJax has the advantages of being quicker to write and easier to read when not rendered. MathML has the advantages of rendering faster and not requiring JavaScript to be enabled.
- ## Communities that do not have MathJax enabled
- - For communities that already have MathJax, I'd like to see MathML available too.
- - For communities that do not have MathJax, I'd still like to see MathML available.
- Unlike MathJax, which slows down page loading and increases data usage due to the extra JavaScript that must be loaded, MathML is built into the browser so enabling it will have no effect on loading time or data usage. I see no reason to have a community-specific switch for MathML. We can simply stop blocking it for all communities, and let the browser handle it automatically.
- ## MathML is straightforward to enable
- No code change is required to allow the use of a `<math>` tag in a post. All that is required is to add 'math' to the list of allowed tags[^1]. I've tested this in my local development environment. Here's a comparison of MathML then MathJax in a post:
- > 
- The first of each pair is MathML, the second is MathJax. In this screenshot they look identical. They look this this in both the editor preview and the saved post. In the live post that I'm viewing locally, the only difference is that if I press refresh the MathJax versions momentarily turn back to raw MathJax, whereas the MathML stays as mathematical notation. The raw MathML never shows, even on a slow connection, in the same way that raw HTML never shows, even on a slow connection.
- <details>
- <summary>The MathML and MathJax used to produce this screenshot</summary>
- ```text
- A fraction inline in the middle of a sentence <math>
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math> as an example.
- A fraction inline in the middle of a sentence $\frac{1+4}{23}$ as an example.
- A fraction on its own line:
- <math display="block">
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math>
- A fraction on its own line:
- $$\frac{1+4}{23}$$
- ```
- </details>
- On a community that does not have MathJax enabled (or for a user who has JavaScript disabled), that same post looks like this:
- > 
- The MathJax versions are not rendered, showing instead as raw MathJax, but the MathML versions are correctly rendered as mathematical notation. Notice that the MathML is rendered in a slightly different font when MathJax is not enabled, but it is still in the correct format. If we wanted perfect replication of the look that MathJax gives, we could include the relevant font in Codidact pages. This would only need to be loaded the first time a Codidact page is viewed, and during that brief loading time the MathML would already be correctly displayed, just in a slightly different font - no raw markup.
- [^1]: To be useful, we'd also need the tags that are used inside a `<math>` tag, such as `<mn>`, `<mo>`, `<mfrac>`, `<mrow>`, but this is still just a matter of adding them to the list of allowed tags. To allow mathematical notation on its own line (rather than inline in a sentence) we'd also need to add 'display' to the list of allowed attributes, to allow `<math display="block">`, but that's the full extent of the changes I needed to make to get this working in my local development environment - simply adding names to 2 lists.
#5: Post edited
- ## Allow use of the `<math>` tag directly
- Whether we convert MathJax to MathML behind the scenes or not, users should be able to directly add `<math>` tags to their posts.
- We currently allow both Markdown and HTML in posts. Markdown has the advantages of being quicker to write and easier to read when not rendered (such as during editing). HTML has the advantage of allowing some things that are not possible in Markdown, such as collapsible hidden sections using a `<details>` tag.
- Similarly, I'd like to see both MathJax and MathML allowed in posts. MathJax has the advantages of being quicker to write and easier to read when not rendered. MathML has the advantages of rendering faster and not requiring JavaScript to be enabled.
- ## Communities that do not have MathJax enabled
- - For communities that already have MathJax, I'd like to see MathML available too.
- - For communities that do not have MathJax, I'd still like to see MathML available.
- Unlike MathJax, which slows down page loading and increases data usage due to the extra JavaScript that must be loaded, MathML is built into the browser so enabling it will have no effect on loading time or data usage. I see no reason to have a community-specific switch for MathML. We can simply stop blocking it for all communities, and let the browser handle it automatically.
- ## MathML is straightforward to enable
- No code change is required to allow the use of a `<math>` tag in a post. All that is required is to add 'math' to the list of allowed tags[^1]. I've tested this in my local development environment. Here's a comparison of MathML then MathJax in a post:
- > 
The first of each pair is MathML, the second is MathJax. In this screenshot they look identical. In the live post that I'm viewing locally, the only difference is that if I press refresh the MathJax versions momentarily turn back to raw MathJax, whereas the MathML stays as mathematical notation. The raw MathML never shows, even on a slow connection, in the same way that raw HTML never shows, even on a slow connection.- <details>
- <summary>The MathML and MathJax used to produce this screenshot</summary>
- ```text
- A fraction inline in the middle of a sentence <math>
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math> as an example.
- A fraction inline in the middle of a sentence $\frac{1+4}{23}$ as an example.
- A fraction on its own line:
- <math display="block">
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math>
- A fraction on its own line:
- $$\frac{1+4}{23}$$
- ```
- </details>
- [^1]: To be useful, we'd also need the tags that are used inside a `<math>` tag, such as `<mn>`, `<mo>`, `<mfrac>`, `<mrow>`, but this is still just a matter of adding them to the list of allowed tags. To allow mathematical notation on its own line (rather than inline in a sentence) we'd also need to add 'display' to the list of allowed attributes, to allow `<math display="block">`, but that's the full extent of the changes I needed to make to get this working in my local development environment - simply adding names to 2 lists.
- ## Allow use of the `<math>` tag directly
- Whether we convert MathJax to MathML behind the scenes or not, users should be able to directly add `<math>` tags to their posts.
- We currently allow both Markdown and HTML in posts. Markdown has the advantages of being quicker to write and easier to read when not rendered (such as during editing). HTML has the advantage of allowing some things that are not possible in Markdown, such as collapsible hidden sections using a `<details>` tag.
- Similarly, I'd like to see both MathJax and MathML allowed in posts. MathJax has the advantages of being quicker to write and easier to read when not rendered. MathML has the advantages of rendering faster and not requiring JavaScript to be enabled.
- ## Communities that do not have MathJax enabled
- - For communities that already have MathJax, I'd like to see MathML available too.
- - For communities that do not have MathJax, I'd still like to see MathML available.
- Unlike MathJax, which slows down page loading and increases data usage due to the extra JavaScript that must be loaded, MathML is built into the browser so enabling it will have no effect on loading time or data usage. I see no reason to have a community-specific switch for MathML. We can simply stop blocking it for all communities, and let the browser handle it automatically.
- ## MathML is straightforward to enable
- No code change is required to allow the use of a `<math>` tag in a post. All that is required is to add 'math' to the list of allowed tags[^1]. I've tested this in my local development environment. Here's a comparison of MathML then MathJax in a post:
- > 
- The first of each pair is MathML, the second is MathJax. In this screenshot they look identical. They look this this in both the editor preview and the saved post. In the live post that I'm viewing locally, the only difference is that if I press refresh the MathJax versions momentarily turn back to raw MathJax, whereas the MathML stays as mathematical notation. The raw MathML never shows, even on a slow connection, in the same way that raw HTML never shows, even on a slow connection.
- <details>
- <summary>The MathML and MathJax used to produce this screenshot</summary>
- ```text
- A fraction inline in the middle of a sentence <math>
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math> as an example.
- A fraction inline in the middle of a sentence $\frac{1+4}{23}$ as an example.
- A fraction on its own line:
- <math display="block">
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math>
- A fraction on its own line:
- $$\frac{1+4}{23}$$
- ```
- </details>
- [^1]: To be useful, we'd also need the tags that are used inside a `<math>` tag, such as `<mn>`, `<mo>`, `<mfrac>`, `<mrow>`, but this is still just a matter of adding them to the list of allowed tags. To allow mathematical notation on its own line (rather than inline in a sentence) we'd also need to add 'display' to the list of allowed attributes, to allow `<math display="block">`, but that's the full extent of the changes I needed to make to get this working in my local development environment - simply adding names to 2 lists.
#4: Post edited
- ## Allow use of the `<math>` tag directly
- Whether we convert MathJax to MathML behind the scenes or not, users should be able to directly add `<math>` tags to their posts.
- We currently allow both Markdown and HTML in posts. Markdown has the advantages of being quicker to write and easier to read when not rendered (such as during editing). HTML has the advantage of allowing some things that are not possible in Markdown, such as collapsible hidden sections using a `<details>` tag.
- Similarly, I'd like to see both MathJax and MathML allowed in posts. MathJax has the advantages of being quicker to write and easier to read when not rendered. MathML has the advantages of rendering faster and not requiring JavaScript to be enabled.
- ## Communities that do not have MathJax enabled
- - For communities that already have MathJax, I'd like to see MathML available too.
- - For communities that do not have MathJax, I'd still like to see MathML available.
Unlike MathJax, which slows down page loading and increases data usage due to the extra JavaScript that must be loaded, MathML is built into the browser so enabling it will have no effect on loading time or data usage. I see no reason to have a community-specific switch for MathML. We can simply stop blocking it, and let the browser handle it automatically.- ## MathML is straightforward to enable
- No code change is required to allow the use of a `<math>` tag in a post. All that is required is to add 'math' to the list of allowed tags[^1]. I've tested this in my local development environment. Here's a comparison of MathML then MathJax in a post:
- > 
- The first of each pair is MathML, the second is MathJax. In this screenshot they look identical. In the live post that I'm viewing locally, the only difference is that if I press refresh the MathJax versions momentarily turn back to raw MathJax, whereas the MathML stays as mathematical notation. The raw MathML never shows, even on a slow connection, in the same way that raw HTML never shows, even on a slow connection.
- <details>
- <summary>The MathML and MathJax used to produce this screenshot</summary>
- ```text
- A fraction inline in the middle of a sentence <math>
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math> as an example.
- A fraction inline in the middle of a sentence $\frac{1+4}{23}$ as an example.
- A fraction on its own line:
- <math display="block">
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math>
- A fraction on its own line:
- $$\frac{1+4}{23}$$
- ```
- </details>
- [^1]: To be useful, we'd also need the tags that are used inside a `<math>` tag, such as `<mn>`, `<mo>`, `<mfrac>`, `<mrow>`, but this is still just a matter of adding them to the list of allowed tags. To allow mathematical notation on its own line (rather than inline in a sentence) we'd also need to add 'display' to the list of allowed attributes, to allow `<math display="block">`, but that's the full extent of the changes I needed to make to get this working in my local development environment - simply adding names to 2 lists.
- ## Allow use of the `<math>` tag directly
- Whether we convert MathJax to MathML behind the scenes or not, users should be able to directly add `<math>` tags to their posts.
- We currently allow both Markdown and HTML in posts. Markdown has the advantages of being quicker to write and easier to read when not rendered (such as during editing). HTML has the advantage of allowing some things that are not possible in Markdown, such as collapsible hidden sections using a `<details>` tag.
- Similarly, I'd like to see both MathJax and MathML allowed in posts. MathJax has the advantages of being quicker to write and easier to read when not rendered. MathML has the advantages of rendering faster and not requiring JavaScript to be enabled.
- ## Communities that do not have MathJax enabled
- - For communities that already have MathJax, I'd like to see MathML available too.
- - For communities that do not have MathJax, I'd still like to see MathML available.
- Unlike MathJax, which slows down page loading and increases data usage due to the extra JavaScript that must be loaded, MathML is built into the browser so enabling it will have no effect on loading time or data usage. I see no reason to have a community-specific switch for MathML. We can simply stop blocking it for all communities, and let the browser handle it automatically.
- ## MathML is straightforward to enable
- No code change is required to allow the use of a `<math>` tag in a post. All that is required is to add 'math' to the list of allowed tags[^1]. I've tested this in my local development environment. Here's a comparison of MathML then MathJax in a post:
- > 
- The first of each pair is MathML, the second is MathJax. In this screenshot they look identical. In the live post that I'm viewing locally, the only difference is that if I press refresh the MathJax versions momentarily turn back to raw MathJax, whereas the MathML stays as mathematical notation. The raw MathML never shows, even on a slow connection, in the same way that raw HTML never shows, even on a slow connection.
- <details>
- <summary>The MathML and MathJax used to produce this screenshot</summary>
- ```text
- A fraction inline in the middle of a sentence <math>
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math> as an example.
- A fraction inline in the middle of a sentence $\frac{1+4}{23}$ as an example.
- A fraction on its own line:
- <math display="block">
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math>
- A fraction on its own line:
- $$\frac{1+4}{23}$$
- ```
- </details>
- [^1]: To be useful, we'd also need the tags that are used inside a `<math>` tag, such as `<mn>`, `<mo>`, `<mfrac>`, `<mrow>`, but this is still just a matter of adding them to the list of allowed tags. To allow mathematical notation on its own line (rather than inline in a sentence) we'd also need to add 'display' to the list of allowed attributes, to allow `<math display="block">`, but that's the full extent of the changes I needed to make to get this working in my local development environment - simply adding names to 2 lists.
#3: Post edited
- ## Allow use of the `<math>` tag directly
- Whether we convert MathJax to MathML behind the scenes or not, users should be able to directly add `<math>` tags to their posts.
- We currently allow both Markdown and HTML in posts. Markdown has the advantages of being quicker to write and easier to read when not rendered (such as during editing). HTML has the advantage of allowing some things that are not possible in Markdown, such as collapsible hidden sections using a `<details>` tag.
- Similarly, I'd like to see both MathJax and MathML allowed in posts. MathJax has the advantages of being quicker to write and easier to read when not rendered. MathML has the advantages of rendering faster and not requiring JavaScript to be enabled.
- ## Communities that do not have MathJax enabled
- - For communities that already have MathJax, I'd like to see MathML available too.
- - For communities that do not have MathJax, I'd still like to see MathML available.
- Unlike MathJax, which slows down page loading and increases data usage due to the extra JavaScript that must be loaded, MathML is built into the browser so enabling it will have no effect on loading time or data usage. I see no reason to have a community-specific switch for MathML. We can simply stop blocking it, and let the browser handle it automatically.
## This is straightforward to enable- No code change is required to allow the use of a `<math>` tag in a post. All that is required is to add 'math' to the list of allowed tags[^1]. I've tested this in my local development environment. Here's a comparison of MathML then MathJax in a post:
- > 
- The first of each pair is MathML, the second is MathJax. In this screenshot they look identical. In the live post that I'm viewing locally, the only difference is that if I press refresh the MathJax versions momentarily turn back to raw MathJax, whereas the MathML stays as mathematical notation. The raw MathML never shows, even on a slow connection, in the same way that raw HTML never shows, even on a slow connection.
- <details>
- <summary>The MathML and MathJax used to produce this screenshot</summary>
- ```text
- A fraction inline in the middle of a sentence <math>
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math> as an example.
- A fraction inline in the middle of a sentence $\frac{1+4}{23}$ as an example.
- A fraction on its own line:
- <math display="block">
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math>
- A fraction on its own line:
- $$\frac{1+4}{23}$$
- ```
- </details>
- [^1]: To be useful, we'd also need the tags that are used inside a `<math>` tag, such as `<mn>`, `<mo>`, `<mfrac>`, `<mrow>`, but this is still just a matter of adding them to the list of allowed tags. To allow mathematical notation on its own line (rather than inline in a sentence) we'd also need to add 'display' to the list of allowed attributes, to allow `<math display="block">`, but that's the full extent of the changes I needed to make to get this working in my local development environment - simply adding names to 2 lists.
- ## Allow use of the `<math>` tag directly
- Whether we convert MathJax to MathML behind the scenes or not, users should be able to directly add `<math>` tags to their posts.
- We currently allow both Markdown and HTML in posts. Markdown has the advantages of being quicker to write and easier to read when not rendered (such as during editing). HTML has the advantage of allowing some things that are not possible in Markdown, such as collapsible hidden sections using a `<details>` tag.
- Similarly, I'd like to see both MathJax and MathML allowed in posts. MathJax has the advantages of being quicker to write and easier to read when not rendered. MathML has the advantages of rendering faster and not requiring JavaScript to be enabled.
- ## Communities that do not have MathJax enabled
- - For communities that already have MathJax, I'd like to see MathML available too.
- - For communities that do not have MathJax, I'd still like to see MathML available.
- Unlike MathJax, which slows down page loading and increases data usage due to the extra JavaScript that must be loaded, MathML is built into the browser so enabling it will have no effect on loading time or data usage. I see no reason to have a community-specific switch for MathML. We can simply stop blocking it, and let the browser handle it automatically.
- ## MathML is straightforward to enable
- No code change is required to allow the use of a `<math>` tag in a post. All that is required is to add 'math' to the list of allowed tags[^1]. I've tested this in my local development environment. Here's a comparison of MathML then MathJax in a post:
- > 
- The first of each pair is MathML, the second is MathJax. In this screenshot they look identical. In the live post that I'm viewing locally, the only difference is that if I press refresh the MathJax versions momentarily turn back to raw MathJax, whereas the MathML stays as mathematical notation. The raw MathML never shows, even on a slow connection, in the same way that raw HTML never shows, even on a slow connection.
- <details>
- <summary>The MathML and MathJax used to produce this screenshot</summary>
- ```text
- A fraction inline in the middle of a sentence <math>
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math> as an example.
- A fraction inline in the middle of a sentence $\frac{1+4}{23}$ as an example.
- A fraction on its own line:
- <math display="block">
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math>
- A fraction on its own line:
- $$\frac{1+4}{23}$$
- ```
- </details>
- [^1]: To be useful, we'd also need the tags that are used inside a `<math>` tag, such as `<mn>`, `<mo>`, `<mfrac>`, `<mrow>`, but this is still just a matter of adding them to the list of allowed tags. To allow mathematical notation on its own line (rather than inline in a sentence) we'd also need to add 'display' to the list of allowed attributes, to allow `<math display="block">`, but that's the full extent of the changes I needed to make to get this working in my local development environment - simply adding names to 2 lists.
#2: Post edited
- ## Allow use of the `<math>` tag directly
- Whether we convert MathJax to MathML behind the scenes or not, users should be able to directly add `<math>` tags to their posts.
- We currently allow both Markdown and HTML in posts. Markdown has the advantages of being quicker to write and easier to read when not rendered (such as during editing). HTML has the advantage of allowing some things that are not possible in Markdown, such as collapsible hidden sections using a `<details>` tag.
- Similarly, I'd like to see both MathJax and MathML allowed in posts. MathJax has the advantages of being quicker to write and easier to read when not rendered. MathML has the advantages of rendering faster and not requiring JavaScript to be enabled.
- ## This is straightforward to enable
- No code change is required to allow the use of a `<math>` tag in a post. All that is required is to add 'math' to the list of allowed tags[^1]. I've tested this in my local development environment. Here's a comparison of MathML then MathJax in a post:
- > 
- The first of each pair is MathML, the second is MathJax. In this screenshot they look identical. In the live post that I'm viewing locally, the only difference is that if I press refresh the MathJax versions momentarily turn back to raw MathJax, whereas the MathML stays as mathematical notation. The raw MathML never shows, even on a slow connection, in the same way that raw HTML never shows, even on a slow connection.
- <details>
- <summary>The MathML and MathJax used to produce this screenshot</summary>
- ```text
- A fraction inline in the middle of a sentence <math>
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math> as an example.
- A fraction inline in the middle of a sentence $\frac{1+4}{23}$ as an example.
- A fraction on its own line:
- <math display="block">
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math>
- A fraction on its own line:
- $$\frac{1+4}{23}$$
- ```
- </details>
- [^1]: To be useful, we'd also need the tags that are used inside a `<math>` tag, such as `<mn>`, `<mo>`, `<mfrac>`, `<mrow>`, but this is still just a matter of adding them to the list of allowed tags. To allow mathematical notation on its own line (rather than inline in a sentence) we'd also need to add 'display' to the list of allowed attributes, to allow `<math display="block">`, but that's the full extent of the changes I needed to make to get this working in my local development environment - simply adding names to 2 lists.
- ## Allow use of the `<math>` tag directly
- Whether we convert MathJax to MathML behind the scenes or not, users should be able to directly add `<math>` tags to their posts.
- We currently allow both Markdown and HTML in posts. Markdown has the advantages of being quicker to write and easier to read when not rendered (such as during editing). HTML has the advantage of allowing some things that are not possible in Markdown, such as collapsible hidden sections using a `<details>` tag.
- Similarly, I'd like to see both MathJax and MathML allowed in posts. MathJax has the advantages of being quicker to write and easier to read when not rendered. MathML has the advantages of rendering faster and not requiring JavaScript to be enabled.
- ## Communities that do not have MathJax enabled
- - For communities that already have MathJax, I'd like to see MathML available too.
- - For communities that do not have MathJax, I'd still like to see MathML available.
- Unlike MathJax, which slows down page loading and increases data usage due to the extra JavaScript that must be loaded, MathML is built into the browser so enabling it will have no effect on loading time or data usage. I see no reason to have a community-specific switch for MathML. We can simply stop blocking it, and let the browser handle it automatically.
- ## This is straightforward to enable
- No code change is required to allow the use of a `<math>` tag in a post. All that is required is to add 'math' to the list of allowed tags[^1]. I've tested this in my local development environment. Here's a comparison of MathML then MathJax in a post:
- > 
- The first of each pair is MathML, the second is MathJax. In this screenshot they look identical. In the live post that I'm viewing locally, the only difference is that if I press refresh the MathJax versions momentarily turn back to raw MathJax, whereas the MathML stays as mathematical notation. The raw MathML never shows, even on a slow connection, in the same way that raw HTML never shows, even on a slow connection.
- <details>
- <summary>The MathML and MathJax used to produce this screenshot</summary>
- ```text
- A fraction inline in the middle of a sentence <math>
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math> as an example.
- A fraction inline in the middle of a sentence $\frac{1+4}{23}$ as an example.
- A fraction on its own line:
- <math display="block">
- <mfrac>
- <mrow>
- <mn>1</mn>
- <mo>+</mo>
- <mn>4</mn>
- </mrow>
- <mn>23</mn>
- </mfrac>
- </math>
- A fraction on its own line:
- $$\frac{1+4}{23}$$
- ```
- </details>
- [^1]: To be useful, we'd also need the tags that are used inside a `<math>` tag, such as `<mn>`, `<mo>`, `<mfrac>`, `<mrow>`, but this is still just a matter of adding them to the list of allowed tags. To allow mathematical notation on its own line (rather than inline in a sentence) we'd also need to add 'display' to the list of allowed attributes, to allow `<math display="block">`, but that's the full extent of the changes I needed to make to get this working in my local development environment - simply adding names to 2 lists.
#1: Initial revision
## Allow use of the `<math>` tag directly Whether we convert MathJax to MathML behind the scenes or not, users should be able to directly add `<math>` tags to their posts. We currently allow both Markdown and HTML in posts. Markdown has the advantages of being quicker to write and easier to read when not rendered (such as during editing). HTML has the advantage of allowing some things that are not possible in Markdown, such as collapsible hidden sections using a `<details>` tag. Similarly, I'd like to see both MathJax and MathML allowed in posts. MathJax has the advantages of being quicker to write and easier to read when not rendered. MathML has the advantages of rendering faster and not requiring JavaScript to be enabled. ## This is straightforward to enable No code change is required to allow the use of a `<math>` tag in a post. All that is required is to add 'math' to the list of allowed tags[^1]. I've tested this in my local development environment. Here's a comparison of MathML then MathJax in a post: >  The first of each pair is MathML, the second is MathJax. In this screenshot they look identical. In the live post that I'm viewing locally, the only difference is that if I press refresh the MathJax versions momentarily turn back to raw MathJax, whereas the MathML stays as mathematical notation. The raw MathML never shows, even on a slow connection, in the same way that raw HTML never shows, even on a slow connection. <details> <summary>The MathML and MathJax used to produce this screenshot</summary> ```text A fraction inline in the middle of a sentence <math> <mfrac> <mrow> <mn>1</mn> <mo>+</mo> <mn>4</mn> </mrow> <mn>23</mn> </mfrac> </math> as an example. A fraction inline in the middle of a sentence $\frac{1+4}{23}$ as an example. A fraction on its own line: <math display="block"> <mfrac> <mrow> <mn>1</mn> <mo>+</mo> <mn>4</mn> </mrow> <mn>23</mn> </mfrac> </math> A fraction on its own line: $$\frac{1+4}{23}$$ ``` </details> [^1]: To be useful, we'd also need the tags that are used inside a `<math>` tag, such as `<mn>`, `<mo>`, `<mfrac>`, `<mrow>`, but this is still just a matter of adding them to the list of allowed tags. To allow mathematical notation on its own line (rather than inline in a sentence) we'd also need to add 'display' to the list of allowed attributes, to allow `<math display="block">`, but that's the full extent of the changes I needed to make to get this working in my local development environment - simply adding names to 2 lists.