Skip to content

Commit

Permalink
Core: Don't thow an error if lookbehing is used without anything matc…
Browse files Browse the repository at this point in the history
…hing.
  • Loading branch information
Golmote committed Mar 3, 2018
1 parent bdbdb7d commit e0cd47f
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion components/prism-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ var _ = _self.Prism = {
}

if(lookbehind) {
lookbehindLength = match[1].length;
lookbehindLength = match[1] ? match[1].length : 0;
}

var from = match.index + lookbehindLength,
Expand Down
2 changes: 1 addition & 1 deletion components/prism-core.min.js

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

2 changes: 1 addition & 1 deletion prism.js
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ var _ = _self.Prism = {
}

if(lookbehind) {
lookbehindLength = match[1].length;
lookbehindLength = match[1] ? match[1].length : 0;
}

var from = match.index + lookbehindLength,
Expand Down

0 comments on commit e0cd47f

Please sign in to comment.