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
Markdown containing HTML is misdetected as rich text #14
HtmlTagRegex matches common tags including <div>, <p>, <span>, <code>, <br>, <a>, <img>.
Impact
Markdown is allowed to contain raw HTML, and technical Markdown very often mentions tags in inline code or fenced blocks. Any of these score 0 and get classified as RichText:
# Layout notes
Wrap the content in `<div class="card">` before rendering.
```html
<p>hello</p>
```
The app then offers "convert to Markdown" on content that is already Markdown, and Ctrl+Enter does the wrong thing.
Suggested fix
Don't zero the score. Instead:
Ignore tags that appear inside fenced blocks or inline code spans when scoring.
Treat remaining raw HTML as a negative weight alongside the other signals rather than an absolute veto, so strong Markdown structure (headings, fences, tables) still wins.
The veto only bites when the clipboard carries both text and HTML — which is exactly what editors (VS Code, browsers, Loop) put there. Same Markdown, with and without an HTML mention:
Clipboard text
HTML also present
Detected
# Title + list + **bold**
editor syntax HTML
Markdown ✅
# Layout + list + `<div class="card">`
editor syntax HTML
RichText ❌
# Title + list + ```html\n<p>hello</p>\n```
editor syntax HTML
RichText ❌
Adding a single inline-code mention of a tag flips a correctly-detected Markdown document to RichText, so Ctrl+Enter then runs HTML → Markdown on content that is already Markdown.
Note the tag mentions above are inside an inline code span and a fenced block respectively — both places where raw HTML is unambiguously not markup.
Activity
trsdn commentedon Aug 19, 2026
Verified repro
The veto only bites when the clipboard carries both text and HTML — which is exactly what editors (VS Code, browsers, Loop) put there. Same Markdown, with and without an HTML mention:
# Title+ list +**bold**Markdown✅# Layout+ list +`<div class="card">`RichText❌# Title+ list +```html\n<p>hello</p>\n```RichText❌Adding a single inline-code mention of a tag flips a correctly-detected Markdown document to
RichText, soCtrl+Enterthen runs HTML → Markdown on content that is already Markdown.Note the tag mentions above are inside an inline code span and a fenced block respectively — both places where raw HTML is unambiguously not markup.