Forum How do I...?

non breaking space breaks conversion

hamishwillee
Hi
I'm doing mediawiki printing using print. I have a geishi code fragment that looks like this:
}
 
if

The line in the middle is rendered as a non breaking space, as shown
<pre class="cpp" style="font-family:monospace;"><span style="color: #008000;">&#125;</span><br />&nbsp;<br /><span style="color: #0000ff;">if</span></pre>

This gives a conversion error:
-:2: error: Entity 'nbsp' not defined

Thing is, any line space could be a non breaking space
1. Is the error correct/OK?
2. Is there any mechanism in the PDF Export from mediawiki that you guys would normally recommend for reporting these sort of errors?

Thanks
H
mikeday
In XML, entities need to be defined before being used. In HTML, there are a bunch of entities that are predefined, including &nsbp. If the content you are converting is really truly XML, then it will need to define this entity in a DTD, or refer to one of the existing XHTML DTDs that defines it. Or you can just treat the content as HTML, which it probably is, by calling $prince->setHTML(1) from PHP.