Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MathML open attribute value disappeared #136

Open
MurakamiShinyu opened this issue Dec 15, 2021 · 0 comments
Open

MathML open attribute value disappeared #136

MurakamiShinyu opened this issue Dec 15, 2021 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@MurakamiShinyu
Copy link
Member

MurakamiShinyu commented Dec 15, 2021

Issue Details

Vivliostyle Pubに報告されたissue

問題のMarkdownファイルの中のMathMLコード:

<math>
  <mrow>
    <mi>h</mi>
    <mo>=</mo>
    <mfenced open="|" close="|">
      <mover><mi>HP</mi><mo>&rarr;</mo></mover>
    </mfenced>
  </mrow>
</math>

vfmでHTMLに変換すると、HTMLの中のMathMLコードは次のように open 属性の値が消えてしまってます:

    <math>
      <mrow>
        <mi>h</mi>
        <mo>=</mo>
        <mfenced open close="|">
          <mover>
            <mi>HP</mi>
            <mo></mo>
          </mover>
        </mfenced>
      </mrow>
    </math>

原因は、open がHTMLではBoolean attribute であり(https://html.spec.whatwg.org/#attr-details-open) 、Boolean attributeは値が何であっても関係ないので値なしに正規化されてしまうということのようです。

HTMLのBoolean attributeでMathML Attributes と同名のものは open だけのようです。
SVGでも同様の問題があるかもしれませんが https://www.w3.org/TR/SVG/attindex.html をざっと見たかぎりでは HTMLのBoolean attribute と同名のものは無いようです。

HTMLのBoolean attributeの値が指定されてたら消してしまうという動作は必要ないのでないかと思います。

vfmだけでなくremarkでのMarkdown→HTML変換で、MarkdownにMathMLが埋め込まれている場合に共通の問題なのでそちらにも報告するとよいかもしれません。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants