-
Notifications
You must be signed in to change notification settings - Fork 8
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
pandoc alerts extension #117
Comments
You're using it correctly, I believe the issue lies with pulldown_cmark_to_cmark (which is used to convert parsed Markdown back into raw Markdown text). When I run this test: #[test]
fn alerts_pulldown_cmark_to_cmark() {
let source = "
> [!NOTE]
> Highlights information that users should take into account, even when skimming.
";
let events = pulldown_cmark::Parser::new(source).into_offset_iter();
let mut roundtripped = String::new();
pulldown_cmark_to_cmark::cmark_with_source_range(
events.map(|(event, range)| (event, Some(range))),
source,
&mut roundtripped,
)
.unwrap();
assert_eq!(source, roundtripped);
} I see that the resulting Markdown has an extra line of the blockquote at the beginning: >
> [!NOTE]
> Highlights information that users should take into account, even when skimming. This makes Pandoc very unhappy and it no longer considers it an alert:
I'll take a look into pulldown_cmark_to_cmark and see if there's an easy way to fix this.
|
Unfortunately I think this'll be blocked for a while. Newer (breaking) versions of pulldown_cmark support alerts, but I'm holding off from updating until Additionally, even the latest pulldown_cmark_to_cmark needs a fix: Byron/pulldown-cmark-to-cmark#86 |
Thank you for taking a look :-) |
#138 implements support for alerts, although note that you shouldn't set |
Hi,
Trying to use Pandoc alerts extension for CommonMark (see second bullet):
https://pandoc.org/releases.html#pandoc-3.1.10-2023-12-12
My markdown file has
If I use https://github.com/lambdalisue/rs-mdbook-alerts it renders in html as expected. I would like to get something similar in pandoc pdf.
In my book.toml I put
from = "commonmark+alerts"
But my resulting pdf has what looks like the raw markdown without the
>
. I know from pandoc issue not to expect svg icon, but I would have expected NOTE without the![]
.I'm using pandoc 3.4.
Am I using the
from=
with the alerts extension correctly?The text was updated successfully, but these errors were encountered: