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
This tool was designed around copying and pasting content from Google Docs, and works reasonably well for that use case. However, some folks have asked about using it with HTML exported from Google Docs (e.g. @kdiogenes discusses this in a PR: #40 (comment)). This doesn’t currently work, but it would be great if it did!
The core issue is that, in exports, all the styles are in a stylesheet instead of inline, so we fail to pick up on them. For example, bold is done with font-weight: 700 in CSS. In copy/pasted output, that CSS is on an element’s style attribute, so we don’t have to do anything special to know that the element should be bold. But in exports, the element has a class attribute that references rules from an inline stylesheet instead. We need a way to parse the stylesheet and resolve the actual CSS properties that are applied as a result.
Links also get wrapped with https://www.google.com/url?q=<url> in exports. I’m not sure what else might be special or different yet.
Fortunately, we already have fixtures for the exported HTML and expected Markdown output; the tests for them are just skipped for now. Implementing this can probably be done by turning on those tests and then making them pass:
This tool was designed around copying and pasting content from Google Docs, and works reasonably well for that use case. However, some folks have asked about using it with HTML exported from Google Docs (e.g. @kdiogenes discusses this in a PR: #40 (comment)). This doesn’t currently work, but it would be great if it did!
The core issue is that, in exports, all the styles are in a stylesheet instead of inline, so we fail to pick up on them. For example, bold is done with
font-weight: 700
in CSS. In copy/pasted output, that CSS is on an element’sstyle
attribute, so we don’t have to do anything special to know that the element should be bold. But in exports, the element has aclass
attribute that references rules from an inline stylesheet instead. We need a way to parse the stylesheet and resolve the actual CSS properties that are applied as a result.Links also get wrapped with
https://www.google.com/url?q=<url>
in exports. I’m not sure what else might be special or different yet.Fortunately, we already have fixtures for the exported HTML and expected Markdown output; the tests for them are just skipped for now. Implementing this can probably be done by turning on those tests and then making them pass:
google-docs-to-markdown/test/unit/convert.test.js
Lines 19 to 29 in 64eebe1
The text was updated successfully, but these errors were encountered: