Markup: Fixed quotes in HTML attribute values (#3442) · PrismJS/prism@ca8eaee · GitHub
Skip to content

Commit ca8eaee

Browse files
Markup: Fixed quotes in HTML attribute values (#3442)
1 parent 0d4b6cb commit ca8eaee

5 files changed

Lines changed: 37 additions & 7 deletions

File tree

‎components/prism-markup.js‎

Lines changed: 4 additions & 1 deletion

‎components/prism-markup.min.js‎

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎prism.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1325,7 +1325,10 @@ Prism.languages.markup = {
13251325
pattern: /^=/,
13261326
alias: 'attr-equals'
13271327
},
1328-
/"|'/
1328+
{
1329+
pattern: /^(\s*)["']|["']$/,
1330+
lookbehind: true
1331+
}
13291332
]
13301333
}
13311334
},

‎tests/languages/markup!+javascript/javascript_inclusion.test‎

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -143,10 +143,7 @@ let foo = '</script>';
143143
["attr-value", [
144144
["punctuation", "="],
145145
["punctuation", "\""],
146-
"this.textContent=",
147-
["punctuation", "'"],
148-
"Over!",
149-
["punctuation", "'"],
146+
"this.textContent='Over!'",
150147
["punctuation", "\""]
151148
]],
152149
["punctuation", ">"]
Lines changed: 27 additions & 0 deletions

0 commit comments

Comments
 (0)