diff --git a/src/core/inlines.js b/src/core/inlines.js index 5b09882411..2b627582c1 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 34a25cd43c..96e5654e0f 100644 --- a/tests/spec/core/inlines-spec.js +++ b/tests/spec/core/inlines-spec.js @@ -160,6 +160,7 @@ describe("Core - Inlines", () => {

TEXT |with spaces : Type with spaces| TEXT

+

TEXT |typeWithQuotes: "valid" or "invalid"| TEXT

TEXT |variable| TEXT

TEXT | ignored | TEXT

TEXT|ignore: Ignore|TEXT

@@ -190,6 +191,10 @@ describe("Core - Inlines", () => { expect(a4.textContent).toBe("with spaces"); expect(a4.dataset.type).toBe("Type with spaces"); + const a5 = doc.querySelector("#a5 var"); + expect(a5.textContent).toBe("typeWithQuotes"); + expect(a5.dataset.type).toBe(`"valid" or "invalid"`); + const b = doc.querySelector("#b var"); expect(b.textContent).toBe("variable"); expect(b.dataset.type).toBeUndefined();