Closed SilentSin closed 2 years ago
After reviewing this issue some more (in the context of other broader changes I've been working on with highlighting), I don't think this particular change is quite right. The behavior of Markdown code blocks is pretty well defined and I don't want to stray from that well-known definition.
We also now have a FencedCodeBlocksShouldHaveLanguage
analyzer in Statiq Web that can catch and warn (or generate an error) about code blocks that don't specify a language.
I suppose it would also be possible to enable this behavior by adding a ProcessHtml
module to the Statiq Web Content
pipeline's post-process phase. That would do the trick nicely for anyone who really wants to change the default language for generated code blocks.
I just found that I can get better syntax highlighting for my code blocks by putting
csharp
at the top like so: