Skip to content

Support astral symbols in encodeForCSS #7

@mathiasbynens

Description

@mathiasbynens

Testing on http://rawgithub.com/chrisisbeef/jquery-encoder/master/site/index.html shows that invalid/incorrect CSS escape sequences are generated for astral symbols:

$.encoder.encodeForCSS('\uD834\uDF06'); // U+1D306 TETRAGRAM FOR CENTRE; GitHub won’t let me use the raw symbol here
// → '\\d834 \\df06 ' which is incorrect
// it should be: '\\1d306 '

Some more info here: http://mathiasbynens.be/notes/css-escapes#other

A robust library for escaping text for use in CSS is: http://mths.be/cssesc Feel free to use it as a dependency for this project.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions