From 29c35f67548e0f0a08d2e339ec9ca9e6d5feb29d Mon Sep 17 00:00:00 2001 From: Alexey Golub Date: Sun, 15 Sep 2019 16:18:30 +0300 Subject: [PATCH] [HTML] Mark code blocks without language so that highlight.js doesn't touch them --- .../HtmlChatLogRenderer.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/DiscordChatExporter.Core.Rendering/HtmlChatLogRenderer.cs b/DiscordChatExporter.Core.Rendering/HtmlChatLogRenderer.cs index e8d2875..3d3028c 100644 --- a/DiscordChatExporter.Core.Rendering/HtmlChatLogRenderer.cs +++ b/DiscordChatExporter.Core.Rendering/HtmlChatLogRenderer.cs @@ -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 $"
{HtmlEncode(multilineCodeBlockNode.Code)}
"; + return $"
{HtmlEncode(multilineCodeBlockNode.Code)}
"; } // Mention node