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
Interpolation Error (?) #22
Comments
Yeah, it's just being caused by certain types of HTML blocks and their precedence: https://github.com/MichaelHatherly/CommonMark.jl/blob/master/src/parsers/blocks.jl#L3-L11. This is something that's defined within the spec so can't be adjusted here. There may be a way to have interpolation happen prior to the HTML tags being parsed, but quite honestly it'll likely just lead to a lot of weird edge cases. |
Don't think this is an 'issue', necessarily, in the sense that if you're writing html, you shouldn't necessarily want to / need to use markdown, maybe worth adding to a doc page at some point in the future, I'll post a snippet below that could be used. |
Interpolation and HTML Snippets: Oil and WaterCommonMark.jl works great with html snippets, like: <p><b>Well done, your cat is called Jimmy now.</b></p> it also works seamlessly with variable interpolation in CommonMark markdown: # This is a dynamically populated $variable and calculation $(1+1) Unfortunately, like oil and water, html snippets and variable interpolation don’t mix, so please don’t expect: <p><b>Well done, your cat is called $cat now.</b></p> to return anything but the html, with the interpolation step ignored: <p><b>Well done, your cat is called $cat now.</b></p> If you want html and interpolation, then you're looking for: HTML("<p><b>Well done, your cat is called $cat now.</b></p>") |
Yeah, something to that effect in the readme would be worth adding. In addition probably worth noting other places where interpolation can't work:
Luckily
Or just parsing the string with
|
+1 agree. Still fighting though for a 'give to Cesar what is Cesar's' in terms of using html utilities for html strings ;) |
Does not interpolate variable
$cat
.Seems related to the nested xml...
The text was updated successfully, but these errors were encountered: