View Single Post
Old Today, 02:48 PM   #18
KevinH
Sigil Developer
KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.KevinH ought to be getting tired of karma fortunes by now.
 
Posts: 9,701
Karma: 6774572
Join Date: Nov 2009
Device: many
Sigil's "Go to link or style" will never work if the user has nested css and does not reformat its css to denest it using Sigil beforehand. But nested css is so rare right now that I am okay with that. The idea was if Go To Link Or Style ever fails, then the code should be denested first (given the last bugfix just now in master) that now works!

The CSSDenest code is invoked by the qCSSParser right before parsing the css. The CSSInfo code uses the qCSSParser to parse a css file to find the line number of each selector (not just classes). The Go To Link or Style runs the CSSInfo code (that uses qCSSParser and CSSDeNest to create a list of all selectors and their starting line numbers and positions in the file) to determine which line of the css file to move to.

At some point in the future, Sigil will autorun the CSSDenest process on first load of any css file and save it. It should change absolutely nothing if the CSS stylesheet uses no nesting (but the bug just fixed was that it added newlines). I was not 100% sure of the denest code and decided using it in qCSSParser was enough until nested css became more common and then moving it to the epub import and add existing stage.

Hope that makes things clearer.
KevinH is offline   Reply With Quote