8000 --strip-comment turns compact list into loose list · Issue #7521 · jgm/pandoc · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

--strip-comment turns compact list into loose list #7521

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

Closed
reagle opened this issue Aug 23, 2021 · 2 comments
Closed

--strip-comment turns compact list into loose list #7521

reagle opened this issue Aug 23, 2021 · 2 comments
Labels

Comments

@reagle
Copy link
reagle commented Aug 23, 2021

As discussed on the list, a stripped comment in a list makes it loose. Here is a minimal example.

  • OS: macOS 11.5.2 20G95 arm64
  • pandoc 2.14.2; Compiled with pandoc-types 1.22, texmath 0.12.3.1, skylighting 0.11
╭─reagle@hom ~/e/clear/data/2web/reagle.org/joseph/2016/min-eg
╰─➤  pandoc test-list-nested.md
<h1 id="nested-list-with-comment">Nested list with comment</h1>
<ul>
<li>this is top 1
<ul>
<li>this is sub 1.1</li>
<li>this is sub 1.2 <!-- - going to think about 1.3 for a bit --></li>
<li>this is sub 1.4</li>
</ul></li>
<li>this is top 2
<ul>
<li>this is sub 2.1</li>
<li>this is sub 2.2</li>
<li>this is sub 2.3</li>
<li>this is sub 2.4</li>
</ul></li>
</ul>
╭─reagle@hom ~/e/clear/data/2web/reagle.org/joseph/2016/min-eg
╰─➤  pandoc --strip-comments test-list-nested.md
<h1 id="nested-list-with-comment">Nested list with comment</h1>
<ul>
<li>this is top 1
<ul>
<li><p>this is sub 1.1</p></li>
<li><p>this is sub 1.2</p></li>
<li><p>this is sub 1.4</p></li>
</ul></li>
<li>this is top 2
<ul>
<li>this is sub 2.1</li>
<li>this is sub 2.2</li>
<li>this is sub 2.3</li>
<li>this is sub 2.4</li>
</ul></li>
</ul>
@reagle reagle added the bug label Aug 23, 2021
@jgm
Copy link
Owner
jgm commented Aug 23, 2021

Minimal test case with expected output:

% pandoc --strip-comments -t native
- hi
  <!-- ok -->
- there
[BulletList
 [[Plain [Str "hi"]]
 ,[Plain [Str "there"]]]]

@jgm
Copy link
Owner
jgm commented Aug 23, 2021

I'm not really sure why this is happening. It seems to be related to the fact that we handle stripped comments as blank RawInline elements; when I change it so stripped comments become <!-- STRIPPED -->, I don't see this behavior.

@jgm jgm closed this as completed in 3f9b7a1 Aug 24, 2021
jgm added a commit that referenced this issue Aug 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants
0