Skip to content

Commit

Permalink
fix: escape non-breaking spaces (fixes #190)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbrsh committed Dec 2, 2017
1 parent 7cefee2 commit 74ed50c
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 5 deletions.
5 changes: 3 additions & 2 deletions dist/moon.js
Original file line number Diff line number Diff line change
Expand Up @@ -629,12 +629,13 @@
var expressionRE = /"[^"]*"|'[^']*'|\d+[a-zA-Z$_]\w*|\.[a-zA-Z$_]\w*|[a-zA-Z$_]\w*:|([a-zA-Z$_]\w*)(?:\s*\()?/g;

// HTML Escapes
var escapeRE = /(?:(?:&(?:lt|gt|quot|amp);)|"|\\|\n)/g;
var escapeRE = /(?:(?:&(?:lt|gt|amp|nbsp|quot);)|"|\\|\n)/g;
var escapeMap = {
"&lt;": '<',
"&gt;": '>',
"&quot;": "\\\"",
"&amp;": '&',
"&nbsp;": ' ',
"&quot;": "\\\"",
'\\': "\\\\",
'"': "\\\"",
'\n': "\\n"
Expand Down
Loading

0 comments on commit 74ed50c

Please sign in to comment.