mirror of
https://github.com/Tyrrrz/DiscordChatExporter.git
synced 2025-05-29 05:55:21 -04:00
[HTML] Mark code blocks without language so that highlight.js doesn't touch them
This commit is contained in:
parent
7b32101517
commit
29c35f6754
1 changed files with 5 additions and 5 deletions
|
@ -92,12 +92,12 @@ namespace DiscordChatExporter.Core.Rendering
|
|||
// Multi-line code block node
|
||||
if (node is MultilineCodeBlockNode multilineCodeBlockNode)
|
||||
{
|
||||
// Set language class for syntax highlighting
|
||||
var languageCssClass = !multilineCodeBlockNode.Language.IsNullOrWhiteSpace()
|
||||
? "language-" + multilineCodeBlockNode.Language
|
||||
: null;
|
||||
// Set CSS class for syntax highlighting
|
||||
var highlightCssClass = !multilineCodeBlockNode.Language.IsNullOrWhiteSpace()
|
||||
? $"language-{multilineCodeBlockNode.Language}"
|
||||
: "nohighlight";
|
||||
|
||||
return $"<div class=\"pre pre--multiline {languageCssClass}\">{HtmlEncode(multilineCodeBlockNode.Code)}</div>";
|
||||
return $"<div class=\"pre pre--multiline {highlightCssClass}\">{HtmlEncode(multilineCodeBlockNode.Code)}</div>";
|
||||
}
|
||||
|
||||
// Mention node
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue