Skip to content

fix: only slash-escape HTML tag angle brackets outside of code sections#322

Closed
markjaquith wants to merge 3 commits into
anomalyco:devfrom
markjaquith:issue/320/fix-slashed-html-tags
Closed

fix: only slash-escape HTML tag angle brackets outside of code sections#322
markjaquith wants to merge 3 commits into
anomalyco:devfrom
markjaquith:issue/320/fix-slashed-html-tags

Conversation

@markjaquith

Copy link
Copy Markdown
Contributor

fixes #320

Added unit tests because this is the kind of twitchy text-parsing that really benefits from it.

What I don't know is if there is a better library to use that can do the "are we in a code block" parsing in a definitely-spec-compliant way. This way is pretty brute force and naive.

@thdxr
thdxr requested a review from adamdotdevin June 23, 2025 19:10
@markjaquith markjaquith changed the title Only slash-escape HTML tag angle brackets outside of code sections fix: only slash-escape HTML tag angle brackets outside of code sections Jun 25, 2025
@adamdotdevin

Copy link
Copy Markdown
Member

my only pause is that i wonder if this problem just goes away if we stop formatting user messages as markdown? assistant messages don't have this problem, right?

@markjaquith

Copy link
Copy Markdown
Contributor Author

Assistant messages do have the problem:

image

@markjaquith

Copy link
Copy Markdown
Contributor Author

Maybe instead of rendering assistant messages as markdown and then trying to slash-escape angle brackets that aren't in code blocks, you should just specifically look for inline code and code blocks to highlight and pass the rest through unadulterated.

@markjaquith

Copy link
Copy Markdown
Contributor Author

Issue got fixed at some point, although at the expense of re-enabling the bug where HTML that is not code-fenced is invisible.

https://opencode.ai/s/pTWGxHOe

bussard76 pushed a commit to bussard76/openwork that referenced this pull request May 12, 2026
bussard76 pushed a commit to bussard76/openwork that referenced this pull request May 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Faulty slash-escaping on HTML tags after fix for invisible HTML tags

3 participants