You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Class stripping removes language-* from code blocks, losing the code language #34
LoopHtmlConverter.Convert strips everyclass attribute from the rendered HTML:
// Remove CSS classes that Markdig addshtml=System.Text.RegularExpressions.Regex.Replace(html,@"\s*class=""[^""]*""","");
Markdig renders a fenced block with its language as <code class="language-cs">. The regex deletes that, so the language is gone from the output HTML.
Repro
Input Markdown:
```csvarx=1;
```
Output HTML:
<pre><code>var x = 1;
</code></pre>
Round-tripping back through HtmlToMarkdownConverter therefore yields an unlabelled fence — the cs hint is lost permanently.
Impact
Code language is dropped on every Markdown → Rich Text conversion, so Loop cannot syntax-highlight and the information cannot be recovered.
The regex is broader than its stated intent ("classes that Markdig adds") — it also strips classes from any raw HTML the user deliberately wrote in their Markdown.
Suggested fix
Preserve language-* classes and strip only what Loop actually chokes on. Either:
narrow the regex so class="language-…" is retained, or
Activity
Keep the code language when stripping CSS classes (#51)