-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Superscripts turn into non superscript #33
Comments
Good catch! Just tried this out and I see what you mean. I’m not sure I’ll get to this before the weekend, but will definitely get this fixed. In the mean time, pull requests are also welcome. :) Looks like this is happening because Google Docs renders HTML like: <span>Test document</span><span><span style="font-size:0.6em;vertical-align:super;">2</span></span> ^ where the “2” is superscripted. The key part is The best fix here probably to expand google-docs-to-markdown/lib/fix-google-html.js Lines 103 to 120 in 8fdaadd
There may also need to be some special handling of those elements in the |
You can have superscript and subscript text in Google Docs, but this app would previously remove the formatting. We now keep it in place, even if it outputs unfortunately verbose markup: most Markdown flavors have no markup for superscript or subscript, so we output HTML tags, e.g: This<sub>is subscripted</sub> and this<sup>is superscripted</sup> text. This also updates most of our Rehype and Unified dependencies (they offer some new utilities and fixes that make this feature easier to implement). I did *not* update Remark here, though, since it has some major changes in v8 that need more careful review (really, I should have some tests). Fixes #33.
@abrambailey this should be fixed now! If you are using https://mr0grog.github.io/google-docs-to-markdown/ things should just work, and if you are using a web3-style link, you should switch to https://bafybeihpbbnpk5f2cze5osp4su5hg52jplz7njwgl6nbqlqinlhwbu4imm.ipfs.dweb.link/ :) |
Amazing. Thank you!!! |
Expected behavior would be paste superscript, get superscript, but ² turns into 2 in the results.
The text was updated successfully, but these errors were encountered: