Automattic\WooCommerce\Vendor\Sabberworm\CSS\Value

Value::parseUnicodeRangeValueprivate staticWC 1.0

Method of the class: Value{}

No Hooks.

Returns

String.

Usage

$result = Value::parseUnicodeRangeValue( $oParserState );
$oParserState(ParserState) (required)
.

Value::parseUnicodeRangeValue() code WC 10.4.3

private static function parseUnicodeRangeValue(ParserState $oParserState)
{
    $iCodepointMaxLength = 6; // Code points outside BMP can use up to six digits
    $sRange = "";
    $oParserState->consume("U+");
    do {
        if ($oParserState->comes('-')) {
            $iCodepointMaxLength = 13; // Max length is 2 six digit code points + the dash(-) between them
        }
        $sRange .= $oParserState->consume(1);
    } while (strlen($sRange) < $iCodepointMaxLength && preg_match("/[A-Fa-f0-9\?-]/", $oParserState->peek()));
    return "U+{$sRange}";
}