sandflow / imscJS

JavaScript library for rendering IMSC Text and Image Profile documents to HTML5
BSD 2-Clause "Simplified" License
83 stars 31 forks source link

Empty `<br/>` generates line area for fillLineGap #190

Open nigelmegitt opened 4 years ago

nigelmegitt commented 4 years ago

When an empty line is inserted using a <br/> it is considered by imscJS as generating an inline area even though it contains no text. The result is that when itts:fillLineGap is true, the background areas of the non-blank lines are extended in a strange way, between the lines that do contain text. At first I thought this might be a consequence of setting ebutts:linePadding but that doesn't make any difference to the behaviour in the block-progression direction.

I'm not sure if the blank line should indeed constitute an inline area (I think not), but this behaviour seems weird to me. Possibly this should be escalated to a specification issue, but raising here for discussion first, since potentially it is an implementation issue.

The test content below generates this sequence of images demonstrating the behaviour:

image

image

image

image

What should be the correct behaviour? It is permitted to insert empty lines with <br/> even if it isn't good practice.

I think the expectation would be that there should be a deliberate gap in the background area regardless of itts:fillLineGap in this case, since there's no inline area generated for these empty lines.

Example IMSC content used to generate the above images ```xml urn:ebu:tt:distribution:2018-04 http://www.w3.org/ns/ttml/profile/imsc1/text