You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #34, I added superscript and subscript support. However, the output is often messier than need be because Google Docs nests the superscript/subscript formatting inside other inline formatting (like bold or italics), so formatting inside the superscript/subscript can break things up into several sup or sub tags.
For example, Google Docs might produce input like the following if only part of a subscript was bold:
<spanstyle="vertical-align: sub;">
Plain text
</span><spanstyle="font-weight: bold;"><spanstyle="vertical-align: sub;">
bold text
</span></span>
Which produces markdown output like:
<sub>Plain text </sub>**<sub>bold text</sub>**
It would probably be nicer to go the other way around and treat the subscript/superscript as the outer layer of nesting if it’s the only thing inside the italic/bold. So we’d wrangle the GDocs HTML from above into something like:
<spanstyle="vertical-align: sub;">
Plain text
</span><spanstyle="vertical-align: sub;"><spanstyle="font-weight: bold;">
bold text
</span></span>
And then merge consecutive <sub> or <sup> elements to ultimately get output like:
<sub>Plain text **bold text**</sub>
The text was updated successfully, but these errors were encountered:
In #34, I added superscript and subscript support. However, the output is often messier than need be because Google Docs nests the superscript/subscript formatting inside other inline formatting (like bold or italics), so formatting inside the superscript/subscript can break things up into several
sup
orsub
tags.For example, Google Docs might produce input like the following if only part of a subscript was bold:
Which produces markdown output like:
It would probably be nicer to go the other way around and treat the subscript/superscript as the outer layer of nesting if it’s the only thing inside the italic/bold. So we’d wrangle the GDocs HTML from above into something like:
And then merge consecutive
<sub>
or<sup>
elements to ultimately get output like:The text was updated successfully, but these errors were encountered: