Closed davidmerfield closed 8 years ago
So my approach to solving this is as follows:
If a text node begins with punctuation that needs to be hung:
Then check if its parent node's previous sibling is also a text node, and if so add the appropriate spacer to the end.
Likewise, if a text node ends with punctuation that needs to be hung
Check if its parent node's next sibling is also a text node, and if so add the appropriate spacer to the start.
What if the text node is not the sole child of its parent? Should I not then apply this process to the siblings of the text node and not its parent?
Fixed in 77df1273a9669b886511fcbe37777bbdbdf76481
<p>Hello, <em>"Mr"</em> Fox.</p>
I need to insert a spacer when the adjacent sibling is a text node.