Skip to content

fix: render brackets literally when a link has no URL (fixes #105) - #121

Open
Ultroncn wants to merge 1 commit into
developit:mainfrom
Ultroncn:fix/no-link-without-href
Open

Ultroncn wants to merge 1 commit into
developit:mainfrom
Ultroncn:fix/no-link-without-href

Conversation

@Ultroncn

Copy link
Copy Markdown

Fixes #105.

[text] with neither an inline URL nor a matching reference definition rendered as <a href="undefined">text</a> — e.g. mSrc [, options ]) became mSrc <a href="undefined">, options </a>). A link is now only created when a URL was actually found; otherwise the brackets are left as literal text, as in CommonMark. The unmatched opening bracket is restored from the placeholder (using the last one, so nested brackets like [a [b] c] also come out literal).

Tests: npm test passes (34 passing, was 33), including a new test covering the reported input, a missing reference, an empty inline URL, nested brackets, and a missing link next to a real one in both orders.

…t#105)

'[text]' with neither an inline URL nor a matching reference
definition rendered as '<a href="undefined">text</a>'. A link
is now only created when a URL was actually found; otherwise the
brackets are left as literal text, as in CommonMark.
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 17, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-17T21:11:31.517058Z c28dcf8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

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.

unexpected link generated

1 participant