Skip to content

fix(serializers): preserve angle-bracket URLs as text - #1466

Merged
rfgamaral merged 2 commits into
mainfrom
ricardo/ignore-angle-bracket-autolinks
Aug 11, 2026
Merged

fix(serializers): preserve angle-bracket URLs as text#1466
rfgamaral merged 2 commits into
mainfrom
ricardo/ignore-angle-bracket-autolinks

Conversation

@rfgamaral

@rfgamaral rfgamaral commented Aug 11, 2026

Copy link
Copy Markdown
Member

Overview

Treats angle-bracket HTTP(S) URLs as plain text when loading stored Markdown into rich-text editors. This prevents unsupported Markdown syntax from becoming a link whether or not the link extension is enabled.

Reference

Related to Doist/Issues#20812

PR Checklist

Test plan

  1. Open the deployed Storybook preview
  2. Open the Default story under Typist Editor → Rich-text
  3. Set the content control to <https://duckduckgo.com>
    • Observe that the editor displays <https://duckduckgo.com> as plain text rather than a link
    • Observe that Markdown Output contains <https://duckduckgo.com> unchanged

Demo

Before After
image image

@rfgamaral rfgamaral added the 👀 Show PR Used for PRs that need a review, but can be merged when CI is green. label Aug 11, 2026
@rfgamaral rfgamaral self-assigned this Aug 11, 2026
@netlify

netlify Bot commented Aug 11, 2026

Copy link
Copy Markdown

Deploy Preview for doist-typist ready!

Name Link
🔨 Latest commit 116677e
🔍 Latest deploy log https://app.netlify.com/projects/doist-typist/deploys/6a7b6332fcf2a300087aa6cd
😎 Deploy Preview https://deploy-preview-1466--doist-typist.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@doistbot doistbot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR treats angle-bracket HTTP(S) URLs as plain text when loading stored Markdown into rich-text editors, preventing them from being parsed as links.

Few things worth tightening:

  • Consider reusing the existing remarkDisableConstructs plugin instead of the new AST-walking plugin. Adding 'autolink' to its disabledConstructs list would disable angle-bracket URL parsing at the micromark level—no AST traversal, source slicing, or regex needed. Since the behavior applies unconditionally, the push should go outside the schema conditionals in that plugin.

I also left one optional follow-up note in the details below.

Optional follow-up note (1)
  • P3 src/serializers/html/plugins/remark-ignore-angle-bracket-autolinks.ts:12: visit(tree as Parent, ...) invokes the callback for every node in the AST, then early-returns for non-link nodes after accessing position properties. Every other visitor in this directory uses the typed form (e.g. visit(tree, 'element', ...)) to skip non-matching nodes. Use visit(tree, 'link', (node, index, parent) => { ... }) to avoid the per-node callback overhead on the serialization hot path, which runs on every document load and scales with document size.

Share FeedbackReview Logs

Comment thread src/serializers/html/plugins/remark-ignore-angle-bracket-autolinks.ts Outdated
@rfgamaral
rfgamaral requested review from a team and Bloomca and removed request for a team August 11, 2026 18:01
@rfgamaral
rfgamaral merged commit 7ecfc21 into main Aug 11, 2026
11 checks passed
@rfgamaral
rfgamaral deleted the ricardo/ignore-angle-bracket-autolinks branch August 11, 2026 18:02
doist-release-bot Bot pushed a commit that referenced this pull request Aug 11, 2026
## [17.0.1](v17.0.0...v17.0.1) (2026-08-11)

### Bug Fixes

* **serializers:** preserve angle-bracket URLs as text ([#1466](#1466)) ([7ecfc21](7ecfc21))
@doist-release-bot

Copy link
Copy Markdown

🎉 This PR is included in version 17.0.1 🎉

The release is available on:

Your semantic-release bot 📦🚀

@doist-release-bot doist-release-bot Bot added the released Pull requests that have been released to production label Aug 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

released Pull requests that have been released to production 👀 Show PR Used for PRs that need a review, but can be merged when CI is green.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants