In CSS <string> token values, WordPress\DataLiberation\CSS\CSSProcessor::get_token_value() reports an incorrect token value when \ is at the end of input.
See the rules for consuming a string token:
Repeatedly consume the next input code point from the stream:
…
U+005C REVERSE SOLIDUS (\)
Related to #222.
Demos
$p = WordPress\DataLiberation\CSS\CSSProcessor::create( "'string\\" );
$p->next_token();
assert( $p->get_token_type() === WordPress\DataLiberation\CSS\CSSProcessor::TOKEN_STRING );
assert( $p->get_token_value() === 'string', 'Expected "string", got ' . var_export( $p->get_token_value(), true ) );
Will throw AssertionError: Expected "string", got 'string�'.
Example of string value equality
"AB" === "AB\{{END-OF-INPUT}}
This should render with a fancy font, <i>not monospace</i>.
<style>
/* Note that the two "AB" strings match. */
body { font-family: 'AB', monospace;}
@font-face {
src: url(https://fonts.gstatic.com/s/lobster/v32/neILzCirqoswsqX9zoKmM4MwWJU.woff2) format('woff2');
font-family: 'AB\
In CSS
<string>token values,WordPress\DataLiberation\CSS\CSSProcessor::get_token_value()reports an incorrect token value when\is at the end of input.See the rules for consuming a string token:
Related to #222.
Demos
Will throw
AssertionError: Expected "string", got 'string�'.Example of string value equality
"AB" === "AB\{{END-OF-INPUT}}