Skip to content

fix(inline): support RFC 3986 characters (+, -, .) in bare URL schemes - #154

Merged
tiensonqin merged 2 commits into
masterfrom
fix/rfc3986-url-schemes
Nov 18, 2026
Merged

tiensonqin merged 2 commits into
masterfrom
fix/rfc3986-url-schemes

Conversation

@tiensonqin

Copy link
Copy Markdown
Collaborator

Summary

Bare URLs (link_inline) and angle-bracket autolinks (quick_link_aux) previously parsed the protocol prefix with take_while1 is_letter_or_digit, rejecting valid RFC 3986 §3.1 scheme characters (+, -, .) such as logseq-og://graph/... and degrading them to Plain text instead of Link.

  • Allow +, -, and . after the first scheme character in link_inline and quick_link_aux.
  • Add unit tests for bare and <...> hyphenated URL schemes (logseq-og://...) in test_markdown.ml and test_org.ml.

Verification

  • dune exec test/test_markdown.exe
  • dune exec test/test_outline_markdown.exe
  • dune exec test/test_org.exe
  • dune exec test/test_export_markdown.exe
  • dune exec test/test_export_opml.exe

Bare URLs and `<scheme:...>` autolinks previously matched scheme names
with `take_while1 is_letter_or_digit`, causing valid RFC 3986 schemes
containing `-`, `+`, or `.` (such as `logseq-og://graph/...` or
`git+https://...`) to fall back to `Plain` text instead of parsing as
`Link`.

Allow `+`, `-`, and `.` after the initial character in `link_inline`
and `quick_link_aux`, and add Markdown and Org inline link tests.
@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

@tiensonqin
tiensonqin merged commit 312966b into master Nov 18, 2026
10 of 11 checks passed
@tiensonqin
tiensonqin deleted the fix/rfc3986-url-schemes branch November 18, 2026 08:31
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.

2 participants