Skip to content

Latest commit

 

History

History
57 lines (51 loc) · 1.37 KB

File metadata and controls

57 lines (51 loc) · 1.37 KB

extended_mathml_attributes

This option allows a specific list of additional MathML attributes to be preserved in the editor content, even if they are not included in the default DOMPurify allowlist. This setting only affects attributes used within MathML markup and has no effect on general HTML content.

Type: Array of Strings

Default value: [] (empty array)

Example: using extended_mathml_attributes

tinymce.init({
  selector: 'textarea',
  extended_mathml_attributes: [ 'linebreak', 'encoding' ]
});
Example of MathML with preserved attributes
<p>
  <math xmlns="http://www.w3.org/1998/Math/MathML">
    <mrow linebreak="newline" encoding="utf8">
      <mi>x</mi>
      <mo>=</mo>
      <mfrac>
        <mrow>
          <mo>&#x2212;</mo>
          <mi>b</mi>
          <mo>&#x00B1;</mo>
          <msqrt>
            <mrow>
              <msup>
                <mi>b</mi>
                <mn>2</mn>
              </msup>
              <mo>&#x2212;</mo>
              <mn>4</mn>
              <mo>&#x2062;</mo>
              <mi>a</mi>
              <mo>&#x2062;</mo>
              <mi>c</mi>
            </mrow>
          </msqrt>
        </mrow>
        <mrow>
          <mn>2</mn>
          <mo>&#x2062;</mo>
          <mi>a</mi>
        </mrow>
      </mfrac>
    </mrow>
  </math>
</p>