Skip to content

Commit

Permalink
Escape angle brackets in the playground script (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
Andarist authored Dec 28, 2023
1 parent c1f81ff commit b8c0878
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@
// formatting
default:
value = serialize(compile(`[namespace]{${value.target.textContent}}`), middleware([prefixer, stringify]))
value = value.replace(/</g, '&lt;').replace(/>/g, '&gt;')
value = value.replace(/(;|\})/g, (match, group) => group + (group === '}' ? '\n\n' : '\n'))
value = value.replace(/(.*?)\{/g, (match, group) => '<span class=selector>' + group.trim() + '</span> {\n')
value = value.replace(/:(.*);/g, (match, group) => ': <span class=value>' + group.trim() + '</span>;')
Expand Down

0 comments on commit b8c0878

Please sign in to comment.