Closed FeralFlora closed 4 months ago
In fact this is working, you need to add whitespace around the tip to trigger the syntax:
echo "\n> [!tip]\n> A Tip\n" | pandoc -f gfm -t html
<div class="tip">
<div class="title">
<p>Tip</p>
</div>
<p>A Tip</p>
</div>
In fact this is working, you need to add whitespace around the tip to trigger the syntax:
echo "\n> [!tip]\n> A Tip\n" | pandoc -f gfm -t html <div class="tip"> <div class="title"> <p>Tip</p> </div> <p>A Tip</p> </div>
I'm not sure why, but when I copy your command and run it, I get:
<p>"\n> [!tip]\n> A Tip\n"</p>
So I can't reproduce your finding with echo in the command prompt. But it does work when I test it using a proper conversion:
Command:
pandoc "callout-test.md" -f gfm -t html -o "callout-test.html"
Test file:
# Testing callouts
> [!tip]
> A Tip
Output:
<h1 id="testing-callouts">Testing callouts</h1>
<div class="tip">
<div class="title">
<p>Tip</p>
</div>
<p>A Tip</p>
</div>
So either the issue can be closed, or perhaps reframed?
I think your terminal is rewriting the <
and >
characters? If you type into stdin directly (use CTRL+D to exit this mode), then you should be able to type in the syntax and get a response out?
I think you may need to use single quotes with echo here, because >
and !
have special meaning in the shell.
Anyway, this works fine as you can see from Try Pandoc:
https://pandoc.org/try/?params=%7B%22text%22%3A%22%3E+%5B%21WARNING%5D%5Cn%22%2C%22to%22%3A%22html5%22%2C%22from%22%3A%22gfm%22%2C%22standalone%22%3Afalse%2C%22embed-resources%22%3Afalse%2C%22table-of-contents%22%3Afalse%2C%22number-sections%22%3Afalse%2C%22citeproc%22%3Afalse%2C%22html-math-method%22%3A%22plain%22%2C%22wrap%22%3A%22auto%22%2C%22highlight-style%22%3Anull%2C%22files%22%3A%7B%7D%2C%22template%22%3Anull%7D
I think you may need to use single quotes with echo here, because
>
and!
have special meaning in the shell. Anyway, this works fine as you can see from Try Pandoc
Yeah, sorry for jumping the gun on this.
I tried with single quotes, but that doesn't echo anything:
But anyway, since it works with proper conversions (not echo), this is some other issue of my own.
Explain the problem.
These two commands:
Produce the same output:
Ergo,
alerts
does nothing. The HTML output ought to be, as far as I understand:The same goes for using
gfm
, wherealerts
is enabled by default. The output is not as expected:Pandoc version? Pandoc version: 3.2 OS: Windows 11