feat(core/inlines): render inline code in [[[…|alias]]] link text#5344
Merged
Conversation
Author aliases in the [[[…|text]]] autolink now run through the same inline-code processing as [= =], so `code` in an alias renders as a <code> element instead of literal backticks. A shared setInlineContent helper applies the processed alias at the three sites that emit alias display text (same-document, cross-spec section, and cross-spec links). Closes #5343
Contributor
There was a problem hiding this comment.
Pull request overview
This PR makes [[[…|alias]]] autolink alias text render inline code spans (backticks) as <code>…</code>, aligning autolink behavior with existing [= =] inline-link processing. It does so by reusing the existing inline backtick processing logic and applying it consistently where alias display text is materialized.
Changes:
- Inline
[[[#id|alias]]]now runs alias text through inline backtick processing so`code`becomes<code>code</code>. - Cross-spec alias display text application (in
core/data-citeandcore/xref-headings) now uses a sharedsetInlineContent()helper to render backticks as<code>. - Adds test coverage for backticks in alias text across same-document, cross-spec section, and cross-spec spec links (including multi-line alias text).
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| tests/spec/core/inlines-spec.js | Adds tests verifying backticks in `[[[… |
| src/core/xref-headings.js | Uses setInlineContent() when applying alias text to cross-spec section links (headings API module). |
| src/core/inlines.js | Processes same-document `[[[#id |
| src/core/data-cite.js | Uses setInlineContent() when applying alias text for non-section data-cite links. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
marcoscaceres
marked this pull request as ready for review
July 3, 2026 03:30
sidvishnoi
approved these changes
Jul 3, 2026
| expect(anchor.textContent).toBe("the fetch method"); | ||
| }); | ||
|
|
||
| it("processes backticks in [[[SPEC|`code`]]] alias text", async () => { |
Member
There was a problem hiding this comment.
This one feels not needed (use case).
Contributor
Author
There was a problem hiding this comment.
I can see myself using this... like [[fetch|fetch()]]].
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #5343
Author aliases in the
[[[…|alias]]]autolink now support inline code, so backticks in the alias render as a<code>element instead of appearing literally, matching how the[= =]inline-link syntax already does it. A sharedsetInlineContenthelper applies the processed alias at the three sites that emit alias display text (same-document, cross-spec section, and cross-spec spec links).