Forum Bugs

Text appearing from the wrong place in paragraph.

elrond25
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?
  1. Screen Shot 2015-03-25 at 17.50.26.png56.3 kB
    screenshot of error
mikeday
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?
elrond25
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.

  1. docs.html226.2 kB
mikeday
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"/&gt;
            &amp;lt;xs:attribute nae two main types of URIs: absolute and relative.
         </p>
elrond25
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
  1. docs-bug.xml44.7 kB
  2. docs.xml204.9 kB
  3. highlight.pack.js296.0 kB
elrond25
Another note. If I insert empty paragraphs before the paragraph you indicated the strange characters go away and the paragraph formats properly
mikeday
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.
elrond25
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

mikeday
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.
elrond25
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