Lectora & strange span behaviour

Lectora breaks some spans while exporting a translated version.

Example:

<div id="text41624"><a name="text41624anc"></a>
<p style="margin-left:15px;text-indent:-15px;line-height:1.127;margin-top:0px;margin-bottom:0px;text-align:left;" >
<span class="text41624Font8" style="position:relative;top:-0px">1.</span ><span style='font:1.0pt "Arial"'>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</span><span class="text41624Font8" >El siguiente cap</span ><span class="text41624Font9" >í</span ><span class="text41624Font8" >tulo:
</span ></p >

The first span: <span class="text41624Font8" style="position:relative;top:-0px">1.</span > should not be there.

After deleting several chapters and the complete navigation from the Lectora title, the SPANs and DIVs are rendered correctly.

Experiment 2: Removing inherited items from the broken pages.

Result: after removing all inherited items, except for the forwards button, the broken DIVs and SPANs work correctly!

Interesting side note: in the chapters afterwards, in which I did NOT disable inheritance, all DIVs and SPANs also continue to work, no strange numbers or other erratic behaviour. There is something wrong in the first chapter!

Experiment 3: Locating the problematic inherited item

By turning on arrays of inherited items I'll try to locate the problematic one.

  • enabling all navigation: no problems
  • nearly all items, except of the comment script: ok
  • enabling all items: now everything works again!

If you're ever stuck in a situation like this, don't give up just yet. Try things and see if you can fix it by actually returning to the normal state.

Here's an example how the error looks like:

Unfortunately I was not able to fix the problem by randomly deleting items this time … it persists.

101121 Update:

Exporting the title with Lectora X does not solve the problem.

101219 Update:

We have analysed the problem. It seems to happen when importing RTF translation files into Lectora. If you copy strings from Lectora and put them into Open Office writer, they sometimes show up with 1) . These are the strings which will be exported as 1. to HTML, creating an additional SPAN.

As a quick solution, I have written this Ruby script (you probably have to modify .php to .html or .htm for your project in this script). Please note that this tool may remove spans which should not be removed, as there is no way to decide on the HTML level.

icf-tool-fix-es-spans

Another quick Lectora tip:

When rendering HTML, it offers the option to you to print. If you have a virtual PDF printer installed, you can save some time by "printing" the errors on it, instead of searching through the wad of output in the HTML render dialog.

Tags: Lectora, broken spans, Lectora inserts strange characters, rendering HTML, virtual PDF printer.

If you're running into problems with Lectora and have a deadline to meet consider using our services.


Leave a Reply