A (revamped) Sass function that will output properly encoded entities.
No clue. I came across https://dev.w3.org/html5/html-author/charref and thought it would be fun. I ran a Node script that output the file then wrote some tests.
The entity
function accepts the actual character, the HTML name without the
ampersand and semi-colon or the decimal number.
body {
&:after {
content: entity('€');
}
}
or
body {
&:after {
content: entity('euro');
}
}
will output
body:after {
content: "\20AC";
}