Skip to content

Preserve input entities in autoLinkWithJSON - #431

Open
WoWHellgarve-HolyDeeW wants to merge 1 commit into
twitter:masterfrom
WoWHellgarve-HolyDeeW:codex/preserve-autolink-entities
Open

WoWHellgarve-HolyDeeW wants to merge 1 commit into
twitter:masterfrom
WoWHellgarve-HolyDeeW:codex/preserve-autolink-entities

Conversation

@WoWHellgarve-HolyDeeW

Copy link
Copy Markdown

Rendering the same JSON twice can shift links after an emoji. The first call rewrites the caller's indices from code points to UTF-16, then the second call converts those offsets again.

Copy each entity and its indices before normalization. The regression test reuses mentions, hashtags and cashtags across two renders. All five JSON autolink conformance cases also produced the expected HTML on both calls.

Fixes #54.

@CLAassistant

CLAassistant commented Dec 2, 2026 •

Copy link
Copy Markdown

CLA assistant check
All committers have signed the CLA.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

JS: autoLinkWithJson mutates one the json input param

2 participants