(String using)
| 447 | } |
| 448 | |
| 449 | private String cssEscape(String using) { |
| 450 | using = CSS_ESCAPE.matcher(using).replaceAll("\\\\$1"); |
| 451 | // CSS only requires the leading-digit escape for ASCII 0-9; non-ASCII Unicode digits |
| 452 | // (e.g. Arabic-Indic, fullwidth) are already valid identifier-start code points and must |
| 453 | // be left untouched, or they collide with the escape for a different ASCII digit. |
| 454 | char first = using.isEmpty() ? '\0' : using.charAt(0); |
| 455 | if (first >= '0' && first <= '9') { |
| 456 | using = "\\" + (30 + Integer.parseInt(using.substring(0, 1))) + " " + using.substring(1); |
| 457 | } |
| 458 | return using; |
| 459 | } |
| 460 | } |
| 461 | } |
no test coverage detected