dhlab-epfl / dhwriter

11 stars 2 forks source link

code block break / export is confused (use br, or use pre - do not use both!) #5

Open cmsmcq opened 11 years ago

cmsmcq commented 11 years ago

The styling widget for "code" appears to be intended for marking blocks of code.

In the HTML exported by dhwriter, the code block as a whole is tagged as pre, which is pretty much what one would expect. But instead of writing the code block out with a newline at the end of each line of the input, it's written out with a br element (and no newline) at the end of each input line. This would be OK (though it produces HTML that's hard to read), but the export procedure also appears to insert newlines to prevent lines getting too long. The result is that input given as

<pb n="[iii]"/>
<p>Quaestiones, quae ad mathematicae
fundamenta pertinent,
etsi hisce temporibus
a multis tractatae,
satisfacienti solutione
et adhuc carent.

is being displayed and exported as if it were

<pb n="[iii]"/>
<p>Quaestiones, quae ad mathematicae
fundamenta pertinent,
etsi hisce temporibus
  a multis tractatae,

  satisfacienti solutione
et adhuc
  carent.

(The extraneous blanks at the beginnings of lines are also an issue. I do not know where they are coming from.)

cmsmcq commented 11 years ago

For the record: the version of dhwriter on the site today (28 October) does has different behavior. The example given above now appears in my TEI export in the form

        <eg>&lt;pb n="[iii]"/&gt; &lt;p&gt;Quaestiones, quae ad mathematicae fundamenta pertinent, etsi hisce temporibus a multis tractatae, satisfacienti solutione et adhuc carent.</eg>

That is, the line breaks in the code block are currently being lost in the TEI export. (They are still present in the interactive display and in the review PDF; I haven't yet checked the other export forms.)