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

--strip-comments ignored for alternative markdown formats #8222

Closed
dubiousjim opened this issue Aug 11, 2022 · 0 comments
Closed

--strip-comments ignored for alternative markdown formats #8222

dubiousjim opened this issue Aug 11, 2022 · 0 comments
Labels

Comments

@dubiousjim
Copy link

dubiousjim commented Aug 11, 2022

Explain the problem.

These are as documented:

$ printf -- '<!-- text -->' | pandoc -fmarkdown -thtml
<!-- text -->
$ printf -- '<!-- text -->' | pandoc -fmarkdown -tnative
[ RawBlock (Format "html") "<!-- text -->" ]
$ printf -- '<!-- text -->' | pandoc -fmarkdown -thtml --strip-comments

$ printf -- '<!-- text -->' | pandoc -fmarkdown -tnative --strip-comments
[]

These are surprising:

$ printf -- '<!-- text -->' | pandoc -fcommonmark -thtml --strip-comments
<!-- text -->
$ printf -- '<!-- text -->' | pandoc -fcommonmark -tnative --strip-comments
[ RawBlock (Format "html") "<!-- text -->\n" ]

Same results for -fgfm and -fcommonmark_x.

Minimally, I'd encourage this to be more explicitly declared in the documentation, which now just says:

--strip-comments
Strip out HTML comments in the Markdown or Textile source, rather than passing them on to Markdown, Textile or HTML output as raw HTM...

Sometimes "Markdown" in the docs is used to cover all of these formats, not just Pandoc-flavored Markdown.

Ideally, though, I'd prefer (at least) the -fcommonmark_x reader to honor the --strip-comments flag.

Pandoc version?
pandoc 2.19 on OS X, custom cabal build with --flags=lua53

@dubiousjim dubiousjim added the bug label Aug 11, 2022
@jgm jgm closed this as completed in 55c524e Aug 13, 2022
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

1 participant