vivliostyle / vfm

⬇️ Open and extendable Markdown syntax and toolchain.
https://vivliostyle.github.io/vfm/#/vfm
Other
69 stars 12 forks source link

div開始タグ直後のテキストが二重に出力される #170

Open MurakamiShinyu opened 10 months ago

MurakamiShinyu commented 10 months ago

不具合が起きるMDの例:

TEST.md

# TEST

<div>
Text

</div>

VFMでのHTMLへの変換結果:

    <section class="level1" aria-labelledby="test">
      <h1 id="test">TEST</h1>
      <div>TextText</div>
    </section>

div要素内のテキストが "Text" のはずなのが "TextText" と二重に出力されている。

この不具合が起きる条件は以下:

Debug log

Run vfm with DEBUG=vfm to see detailed log.

DEBUG=vfm vfm TEST.md
  vfm 
  vfm ### mdast ### +0ms
  vfm root[1]
  vfm └─0 section[3]
  vfm     │ data: {"hName":"section","hProperties":{"class":["level1"],"aria-labelledby":"test"}}
  vfm     │ depth: 1
  vfm     ├─0 heading[1]
  vfm     │   │ depth: 1
  vfm     │   │ data: {"hProperties":{"id":"test"},"id":"test"}
  vfm     │   └─0 text "TEST"
  vfm     ├─1 html "<div>\nText"
  vfm     └─2 html "</div>" +0ms
  vfm 
  vfm ### hast ### +3ms
  vfm root[1] (1:1-7:1, 0-27)
  vfm │ data: {"quirksMode":false}
  vfm └─0 element<section>[2]
  vfm     │ properties: {"className":["level1"],"ariaLabelledBy":["test"]}
  vfm     ├─0 element<h1>[1]
  vfm     │   │ properties: {"id":"test"}
  vfm     │   └─0 text "TEST"
  vfm     └─1 element<div>[1] (1:1-1:7, 0-6)
  vfm         │ properties: {}
  vfm         └─0 text "\nTextText" (1:6-1:1, 5-0) +1ms
  vfm {} +2ms
<!doctype html>
<html>
  <head>
    <meta charset="utf-8">
    <title>TEST</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">
  </head>
  <body>
    <section class="level1" aria-labelledby="test">
      <h1 id="test">TEST</h1>
      <div>TextText</div>
    </section>
  </body>
</html>