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

「2. Step2」が「1. Step2」と出力されることがある #169

Open
makoto-soracom opened this issue Jun 12, 2023 · 1 comment
Open
Assignees
Labels
bug Something isn't working

Comments

@makoto-soracom
Copy link

Issue Details

Vivliostyle で以下のように書いた md から Preview を見たり PDF を作成すると、Step2 に対して value="1" が設定されるため、2 ではなく 1 と表示されます。

1. Step1

    - Bullet1

2. Step2
  • VFM version
    • 2.1.0
  • Node.js version
    • 16.16.1

Expected Behavior

Step2 が、「2. Step2」と表示される。

Actual Behavior

Step2 が、「1. Step2」と表示される。

Debug log (Any)

Run vfm with DEBUG=vfm to see detailed log.

DEBUG=vfm vfm TEST.md

上記のコマンドではどういうわけか問題がありません。

  vfm 
  vfm ### mdast ### +0ms
  vfm root[1]
  vfm └─0 list[2]
  vfm     │ ordered: true
  vfm     │ start: 1
  vfm     │ spread: true
  vfm     ├─0 listItem[2]
  vfm     │   │ spread: true
  vfm     │   │ checked: null
  vfm     │   ├─0 paragraph[1]
  vfm     │   │   └─0 text "Step1"
  vfm     │   └─1 list[1]
  vfm     │       │ ordered: false
  vfm     │       │ start: null
  vfm     │       │ spread: false
  vfm     │       └─0 listItem[1]
  vfm     │           │ spread: false
  vfm     │           │ checked: null
  vfm     │           └─0 paragraph[1]
  vfm     │               └─0 text "Bullet1"
  vfm     └─1 listItem[1]
  vfm         │ spread: false
  vfm         │ checked: null
  vfm         └─0 paragraph[1]
  vfm             └─0 text "Step2" +2ms
  vfm 
  vfm ### hast ### +8ms
  vfm root[1]
  vfm │ data: {"quirksMode":false}
  vfm └─0 element<ol>[5]
  vfm     │ properties: {}
  vfm     ├─0 text "\n"
  vfm     ├─1 element<li>[5]
  vfm     │   │ properties: {}
  vfm     │   ├─0 text "\n"
  vfm     │   ├─1 element<p>[1]
  vfm     │   │   │ properties: {}
  vfm     │   │   └─0 text "Step1"
  vfm     │   ├─2 text "\n"
  vfm     │   ├─3 element<ul>[3]
  vfm     │   │   │ properties: {}
  vfm     │   │   ├─0 text "\n"
<html>
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
  </head>
  <body>
    <ol>
      <li>
        <p>Step1</p>
        <ul>
          <li>Bullet1</li>
        </ul>
      </li>
      <li>
        <p>Step2</p>
      </li>
    </ol>
  </body>
</html>

Screenshots (Any)

If applicable, add screenshots to help explain your problem.

image

To Reproduce

Steps to reproduce the behavior:

上記の markdown で PDF を作成するとスクリーンショットのようになります。

Additional Context

@makoto-soracom makoto-soracom added the bug Something isn't working label Jun 12, 2023
@makoto-soracom makoto-soracom changed the title 2. Step2 が「1. Step2」と 「2. Step2」が「1. Step2」と出力されることがある Jun 12, 2023
@MurakamiShinyu
Copy link
Member

私の方でテストしたのですが、現象が再現できません。

Vivliostyle CLI で

vivliostyle build TEST.md -o output.pdf

として生成されるPDFを見ると次のように正常な結果です:

スクリーンショット 2023-08-15 23 41 38
DEBUG=vfm vfm TEST.md

上記のコマンドではどういうわけか問題がありません。

と書かれているのは、Vivliostyle CLI では問題が起きるけれど、vfmコマンド単体では問題が起きないという意味でしょうか? そうだとすると、vfmとは別の問題である可能性があります。
(vfmから変換したHTMLに問題がなくてHTMLからのプレビューやPDF出力で問題が起きているなら、Vivliostyleの組版エンジン vivliostyle.js の問題です)

私の方での Vivliostyle CLI でのテストでは上述のとおり再現できていないのですが、何か条件が違っていることが考えられます。何かtheme(CSSスタイルシート)の指定などしているでしょうか?
問題が再現する条件をもっと詳しく教えてください。

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

3 participants