Text appearing from the wrong place in paragraph.
The text from a preformatted (pre code) block appears in a paragraph as in the image below where the first line has text from a later code example. I was able to fix it by inserting empty paragraph tags.
Checking the HTML source shows no sign of the error. It's just on Prince.
I'm wondering 2 things:
Could this have anything to do with using the object-key polyfill to get highlight.js to work?
Is this a limitation on the unlicensed version of Prince?
- Screen Shot 2015-03-25 at 17.50.26.png 56.3 kB
Looks like an issue with the markup, can you attach the input document or the relevant part of it?
Also, does the problem still occur when scripts are not run?
I am validating the source XML and the intermediate XHTML file. The PDF and only the PDF experiences the problem.
I've attached the XHTML file that I feed to Prince.
- docs.html 226.2 kB
I can't reproduce the problem when JavaScript is not enabled, so it might be something related to HighlightJS. Can you attach the lib/highlight.pack.js file you are using as well?
There does seem to be some strange text in docs.html, eg. this paragraph:
<p>dth" type="xs:nonNegativeInteger" use="required"/>
&lt;xs:attribute nae two main types of URIs: absolute and relative.
</p>
When trying to reduce the issue to a smaller file the problem doesn't happen at all.
The source XML file, the XML reduced test case and the highlight.js file are attached
- docs-bug.xml 44.7 kB
- docs.xml 204.9 kB
- highlight.pack.js 296.0 kB
Another note. If I insert empty paragraphs before the paragraph you indicated the strange characters go away and the paragraph formats properly
Wait, what? This is an XML document, the last document was a HTML document. If you are running this through an XSLT processor to generate HTML, then that may be doing other unwanted things.
when n i convert it to HTML without adding the object.key polyfill it does not exhibit the problem.
I will research the XSLT angle but it has worked without a problem until now
If it works when HighlightJS is disabled then that's helpful. But it seems like there might be more than one issue here, as the XSLT appears to be mangling some of the text, and then HighlightJS is going wrong later.
Once I removed the object.key polyfill I've run the transformation multiple times and it does not show the garbled text.
If I cut the document into smaller sections with or without the object.key the transformation does not exhibit the garbled text
If I create multiple files from the same source they do not show any garbled text
I do not think it's the transformation but will keep digging