radkovo / jStyleParser

jStyleParser is a CSS parser written in Java. It has its own application interface that is designed to allow an efficient CSS processing in Java and mapping the values to the Java data types. It parses CSS 2.1 style sheets into structures that can be efficiently assigned to DOM elements. It is intended be the primary CSS parser for the CSSBox library. While handling errors, it is user agent conforming according to the CSS specification.
http://cssbox.sourceforge.net/jstyleparser/
GNU Lesser General Public License v3.0
92 stars 49 forks source link

Bug nth-child selector #108

Closed DotMaui closed 4 years ago

DotMaui commented 4 years ago

If I parsed this rule:

.ui-autocomplete li div.blocco-arrivo span:nth-child(1) { font-size: 12px; color: #888 }

and I go to retrieve the selector the result is the following:

.ui-autocomplete li div.blocco-arrivo span:nth-child(\31)

With a \3 that shouldn't be there.

Here the complete example: dotmaui.com/pastebin/p4W7lzaW

radkovo commented 4 years ago

Thanks for reporting this, there was some excessive escaping included. I fixed that and I hope that it won't cause other problems.

DotMaui commented 4 years ago

thank you