Skip to content

Commit

Permalink
Removed replace call
Browse files Browse the repository at this point in the history
  • Loading branch information
RunDevelopment committed Mar 5, 2021
1 parent 909642d commit 608e046
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
3 changes: 1 addition & 2 deletions components/prism-markup.js
Original file line number Diff line number Diff line change
Expand Up @@ -135,8 +135,7 @@ Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
value: function (attrName, lang) {
Prism.languages.markup.tag.inside['special-attr'].push({
pattern: RegExp(
/(^|["'\s])(?:__)\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source
.replace(/__/, function () { return attrName; }),
/(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
'i'
),
lookbehind: true,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-markup.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 1 addition & 2 deletions prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -1360,8 +1360,7 @@ Object.defineProperty(Prism.languages.markup.tag, 'addAttribute', {
value: function (attrName, lang) {
Prism.languages.markup.tag.inside['special-attr'].push({
pattern: RegExp(
/(^|["'\s])(?:__)\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source
.replace(/__/, function () { return attrName; }),
/(^|["'\s])/.source + '(?:' + attrName + ')' + /\s*=\s*(?:"[^"]*"|'[^']*'|[^\s'">=]+(?=[\s>]))/.source,
'i'
),
lookbehind: true,
Expand Down

0 comments on commit 608e046

Please sign in to comment.