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

Ignore hard line breaks at the end of fancy list items #508

Closed
Witiko opened this issue Oct 4, 2024 · 0 comments · Fixed by #509
Closed

Ignore hard line breaks at the end of fancy list items #508

Witiko opened this issue Oct 4, 2024 · 0 comments · Fixed by #509
Assignees
Labels
bug conversion output Related to the output format of the Markdown-to-TeX conversion lua Related to the Lua interface and implementation syntax extension Related to syntax extensions and dialects of markdown
Milestone

Comments

@Witiko
Copy link
Owner

Witiko commented Oct 4, 2024

On the first glance, hard line breaks are ignored at the end of unordered and ordered list items, as expected:

$ docker run --pull=always --rm -i witiko/markdown markdown-cli <<< $'- foo  \n- bar\n  bar  \n- baz  '
\markdownRendererDocumentBegin
\markdownRendererUlBegin
\markdownRendererUlItem foo\markdownRendererUlItemEnd 
\markdownRendererUlItem bar\markdownRendererSoftLineBreak
{}bar\markdownRendererUlItemEnd 
\markdownRendererUlItem baz\markdownRendererUlItemEnd 
\markdownRendererUlEnd \markdownRendererDocumentEnd
$ docker run --pull=always --rm -i witiko/markdown markdown-cli <<< $'1. foo  \n2. bar\n  bar  \n3. baz  '
\markdownRendererDocumentBegin
\markdownRendererOlBegin
\markdownRendererOlItemWithNumber{1}foo\markdownRendererOlItemEnd 
\markdownRendererOlItemWithNumber{2}bar\markdownRendererSoftLineBreak
{}bar\markdownRendererOlItemEnd 
\markdownRendererOlItemWithNumber{3}baz\markdownRendererOlItemEnd 
\markdownRendererOlEnd \markdownRendererDocumentEnd

However, they are not entirely ignored, since they change \markdownRendererOlBeginTight to \markdownRendererOlBegin. Therefore, even if they do not produce a \markdownRendererHardLineBreak, they are recognized at some level rather than ignored.

Furthermore, hard line breaks are not ignored in fancy lists when the option fancyLists is enabled:

$ docker run --pull=always --rm -i witiko/markdown markdown-cli fancyLists=true <<< $'a. foo  \nb. bar\n  bar  \nc. baz  '
\markdownRendererDocumentBegin
\markdownRendererFancyOlBeginTight{LowerAlpha}{Period}\markdownRendererFancyOlItemWithNumber{1}foo\markdownRendererHardLineBreak
{}b. bar\markdownRendererSoftLineBreak
{}bar\markdownRendererHardLineBreak
{}c. baz\markdownRendererFancyOlItemEnd 
\markdownRendererFancyOlEndTight \markdownRendererDocumentEnd
@Witiko Witiko added bug syntax extension Related to syntax extensions and dialects of markdown labels Oct 4, 2024
@Witiko Witiko added this to the 3.8.0 milestone Oct 4, 2024
Witiko added a commit to istqborg/istqb_product_base that referenced this issue Oct 4, 2024
Witiko added a commit to istqborg/istqb_product_template that referenced this issue Oct 4, 2024
Witiko added a commit to istqborg/istqb_product_base that referenced this issue Oct 4, 2024
@Witiko Witiko changed the title Ignore hard line breaks at the end of a fancy list item Ignore hard line breaks at the end of fancy list items Oct 4, 2024
Witiko added a commit that referenced this issue Oct 4, 2024
@Witiko Witiko added lua Related to the Lua interface and implementation conversion output Related to the output format of the Markdown-to-TeX conversion labels Oct 4, 2024
Witiko added a commit that referenced this issue Oct 4, 2024
Witiko added a commit that referenced this issue Oct 4, 2024
@Witiko Witiko modified the milestones: 3.8.0, 3.8.1 Oct 31, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug conversion output Related to the output format of the Markdown-to-TeX conversion lua Related to the Lua interface and implementation syntax extension Related to syntax extensions and dialects of markdown
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants