Skip to content

Commit

Permalink
Fixed that selector pattern can take exponential time (#1499)
Browse files Browse the repository at this point in the history
Fixes #1498.
  • Loading branch information
RunDevelopment authored and mAAdhaTTah committed Aug 19, 2018
1 parent 7af8f8b commit 0f75d9d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions components/prism-scss.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Prism.languages.scss = Prism.languages.extend('css', {
// this one was hard to do, so please be careful if you edit this one :)
'selector': {
// Initial look-ahead is used to prevent matching of blank selectors
pattern: /(?=\S)[^@;{}()]?(?:[^@;{}()]|&|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}]+[:{][^}]+))/m,
pattern: /(?=\S)[^@;{}()]?(?:[^@;{}()]|#\{\$[-\w]+\})+(?=\s*\{(?:\}|\s|[^}]+[:{][^}]+))/m,
inside: {
'parent': {
pattern: /&/,
Expand Down Expand Up @@ -72,4 +72,4 @@ Prism.languages.insertBefore('scss', 'function', {
}
});

Prism.languages.scss['atrule'].inside.rest = Prism.languages.scss;
Prism.languages.scss['atrule'].inside.rest = Prism.languages.scss;
2 changes: 1 addition & 1 deletion components/prism-scss.min.js

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

0 comments on commit 0f75d9d

Please sign in to comment.