Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit 6a7a188

Browse files
EladBezalelThomasBurleson
authored andcommitted
fix(codepens): using unicode characters to avoid codepen's unescaping
- Codepen was unescaping &lt; (<) and &gt; (>) which caused, on some demos, an unclosed elements (like `<md-select>`). Used different unicode lookalike characters so it won't be considered as an element fixes #8761 Closes #9314
1 parent 9fa6a97 commit 6a7a188

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

docs/app/js/codepen.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,14 @@
4141
function escapeJsonQuotes(json) {
4242
return JSON.stringify(json)
4343
.replace(/'/g, "&amp;apos;")
44-
.replace(/"/g, "&amp;quot;");
44+
.replace(/"/g, "&amp;quot;")
45+
/**
46+
* Codepen was unescaping &lt; (<) and &gt; (>) which caused, on some demos,
47+
* an unclosed elements (like <md-select>).
48+
* Used different unicode lookalike characters so it won't be considered as an element
49+
*/
50+
.replace(/&amp;lt;/g, "&#x02C2;") // http://graphemica.com/%CB%82
51+
.replace(/&amp;gt;/g, "&#x02C3;"); // http://graphemica.com/%CB%83
4552
}
4653
}
4754

0 commit comments

Comments
 (0)