Skip to content

Markdown and Razor #109

Answered by daveaglick
ror3d asked this question in Q&A
Nov 28, 2021 · 1 comments · 10 replies
Discussion options

You must be logged in to vote

I think Markdown is converting the @ to @

That's correct. The raw RenderMarkdown module has a toggle for this behavior, but in Statiq Web it's configured to HTML escape a single @ symbol since we know Razor will be run on the rendered Markdown afterwards. This is a little tricky because without that escaping we were getting all kinds of problem reports of folks not understanding why things like email addresses in their Markdown were triggering errors when processed by Razor.

The good news is that it's easy to un-escape the @ HTML escaping using \@ in your Markdown. I.e. \@DateTime.Now.ToString().

Let me know if you have any trouble with that.

Replies: 1 comment 10 replies

Comment options

You must be logged in to vote
10 replies
@ror3d
Comment options

@daveaglick
Comment options

@ror3d
Comment options

@daveaglick
Comment options

@ror3d
Comment options

Answer selected by ror3d
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants