Skip to content

html → markdown ignores <ol start> (storage → markdown honors it since #246) #252

Description

@pchuri

Follow-up from #243 / #247 and #241 / #246.

Description
#246 made storage → markdown honor <ol start="N">, but the html → markdown converter (lib/html-to-markdown.js, used by convert --input-format html) still ignores start and always numbers from 1.

Repro (v2.25.8)

htmlToMarkdown('<ol start="3"><li>a</li><li>b</li></ol>')

Actual:

1. a
2. b

Expected, matching storage → markdown since #246:

3. a
4. b

Notes

  • Reuse the start parsing rules from fix(storage-walker): honor <ol start> in storage → markdown #246 (resolveListStart in lib/storage-walker.js): non-negative integers only, at most 9 digits, anything else falls back to 1.
  • The continuation indent is already derived from the marker width, so 9. → 10. should indent nested content correctly.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions