diff --git a/src/core/inlines.js b/src/core/inlines.js index 2b627582c1..71f8308b98 100644 --- a/src/core/inlines.js +++ b/src/core/inlines.js @@ -65,7 +65,7 @@ const l10n = getIntlData(localizationStrings); // add support. const inlineCodeRegExp = /(?:`[^`]+`)(?!`)/; // `code` const inlineIdlReference = /(?:{{[^}]+\?*}})/; // {{ WebIDLThing }}, {{ WebIDLThing? }} -const inlineVariable = /\B\|\w[\w\s]*(?:\s*:[\w\s&;"<>]+\??)?\|\B/; // |var : Type?| +const inlineVariable = /\B\|\w[\w\s]*(?:\s*:[\w\s&;"?<>]+\??)?\|\B/; // |var : Type?| const inlineCitation = /(?:\[\[(?:!|\\|\?)?[\w.-]+(?:|[^\]]+)?\]\])/; // [[citation]] const inlineExpansion = /(?:\[\[\[(?:!|\\|\?)?#?[\w-.]+\]\]\])/; // [[[expand]]] const inlineAnchor = /(?:\[=[^=]+=\])/; // Inline [= For/link =] diff --git a/tests/spec/core/inlines-spec.js b/tests/spec/core/inlines-spec.js index 96e5654e0f..7e26c43818 100644 --- a/tests/spec/core/inlines-spec.js +++ b/tests/spec/core/inlines-spec.js @@ -171,7 +171,7 @@ describe("Core - Inlines", () => {

TEXT |var: Generic<int>| TEXT |var2: Generic<unsigned short int>|

-

|var 1: null type spaces?| and |var 2 : NullableType?|

+

|var 1: null type spaces?| and |var 2 : NullableType?| and |var 3: Generic<NullableType?>|

`; const doc = await makeRSDoc(makeStandardOps(null, body)); @@ -223,11 +223,14 @@ describe("Core - Inlines", () => { expect(h[1].textContent).toBe("var2"); expect(h[1].dataset.type).toBe("Generic"); - const [nullVar1, nullVar2] = doc.querySelectorAll("#nulls > var"); - expect(nullVar1.textContent).toBe("var 1"); - expect(nullVar1.dataset.type).toBe("null type spaces?"); - expect(nullVar2.textContent).toBe("var 2"); - expect(nullVar2.dataset.type).toBe("NullableType?"); + const nulls = doc.querySelectorAll("#nulls > var"); + expect(nulls).toHaveSize(3); + expect(nulls[0].textContent).toBe("var 1"); + expect(nulls[0].dataset.type).toBe("null type spaces?"); + expect(nulls[1].textContent).toBe("var 2"); + expect(nulls[1].dataset.type).toBe("NullableType?"); + expect(nulls[2].textContent).toBe("var 3"); + expect(nulls[2].dataset.type).toBe("Generic"); }); it("expands inline references and they get classified as normative/informative correctly", async () => {