Core HTML conversion loses inline-code boundary backticks

Open Beginner friendly
#47,409 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Active
Tech stack
typescript
Domain
tooling

Research direction

Start at WebFetchTool.convertHTMLToMarkdown in the built-in webfetch converter and reproduce the TypeScript example from the issue. Verify that leading and trailing literal backticks are preserved, including the shown output and one-sided cases; done when the generated Markdown renders the complete code content while internal backticks still work.

Written by the indexing model from the issue text.

Description

Description

Converting HTML inline code can lose literal backticks at the start or end of its contents. The generated delimiters join the content's backticks.

Plugins

Built-in webfetch converter; no external plugins.

OpenCode version

V2 source checkout at 541937d12449e64d078c67e9013f1c288004b83f.

Steps to reproduce
WebFetchTool.convertHTMLToMarkdown("<p>Use <code>&#96;x&#96;</code>.</p>")
// Actual:   "Use ```x```."
// Expected: "Use `` `x` ``."

The actual Markdown renders code containing only x, losing both literal backticks. Leading-only and trailing-only backticks can also prevent the code span from parsing. Internal backticks do not trigger the same failure.

Operating System

macOS arm64, Bun 1.4.1.

Dominant language
TypeScript
Stars
209k
Forks
27.5k
Avg merge
7h 20m
Merged PRs (30d)
358

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from anomalyco/opencode

All issues in anomalyco/opencode

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.