sysreptor
sysreptor copied to clipboard
Fix space after figure references
When referencing figures, the figure ref title is intentionally hidden. However, due to the ref title being hidden, there is no implicit space added to the ::before pseudo-element under certain circumstances:
<ref to="fig1" />abc
<figure id="fig1">...</figure>
<ref to="fig1" />def
Here, the first reference would render as Figure 1abc, whereas the second reference renders as Figure 1 abc.
This PR simply forces the space to be present for figure references, resolving this inconsistency. (Note that due to an explicit space being present, there isn't any implicit space being added during rendering -> there aren't any double spaces introduced with this fix)
Hi, the root cause is an upstream bug in weasyprint and not something we can easily fix via CSS. See #248 for details.
Always adding a space via CSS fixes the cases when there should be a space (e.g. regular text, followed by another word), but it also adds spaces when there shouldn't be one (e.g. at the end of a sentences before the dot or in parentheses).
... as described in <ref to="fig1" />.
(see <ref to="fig1" />)
I guess we have to wait until the bug is fixed in weasyprint.
This one has been a problem, so I've just had to go through a whole report looking for this issue.