Skip to content

Commit

Permalink
Fix regex that generates html for 'new' keyword (close #1201)
Browse files Browse the repository at this point in the history
  • Loading branch information
jrhdoty authored and travisjeffery committed May 2, 2014
1 parent ca35545 commit 961c539
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ function highlight(js) {
.replace(/('.*?')/gm, '<span class="string">$1</span>')
.replace(/(\d+\.\d+)/gm, '<span class="number">$1</span>')
.replace(/(\d+)/gm, '<span class="number">$1</span>')
.replace(/\bnew *(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>')
.replace(/\bnew[ \t]+(\w+)/gm, '<span class="keyword">new</span> <span class="init">$1</span>')
.replace(/\b(function|new|throw|return|var|if|else)\b/gm, '<span class="keyword">$1</span>')
}

Expand Down

0 comments on commit 961c539

Please sign in to comment.