Quote:
Originally Posted by davidfor
This shouldn't matter. But, for some reason, when this is displayed on the Kobo devices, the new lines are actually interpreted as new lines. Which means there is an extra line between each of the above. And it gets worse with the full template I use. I have reported this to Kobo and will have to wait to see what happens. In the meantime...
Should there be a difference between the two?
As a workaround, I could do a replace of new lines with spaces. But, if there are new lines in the actual text, that could affect the output in undesirable ways. Is there any other way to push it through the formatting that the basic template does?
|
This is happening because of a change to GPM templates. For GPM, in the past all sequences of space-like characters were changed to a single space using the regular expression r'\s+'. That was changed recently so that newlines could pass through, now stripping spaces from the beginning and the end.
There isn't any way to turn the old behavior back on for GPM templates. However, you can get the equivalent by doing re(x, '\s+', ' '), which will produce the same answer as before.
BTW: only for the record as you clearly know it, the Kobo is getting it wrong. In HTML a newline is equivalent to a space (and to other characters). It can be made significant using the "white-space" style.