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
fix: undefined glyphType and nested lists #5
Conversation
It seems like GoogleDocs API does not set `glyphType` for unordered lists
Fix for UL
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Probably need to regenerate some of the snapshots which were probably incorrect. I think |
Moreover, it seems your reduce func in transform at I'm not sure yet how and where it should be treated - at hast level or later at html, but i've just started :) |
Since I'm new to TS, could you please help me with this? Thanx in advance! ...
// get last child Element from element's children
const getLastElementChild = (el: Element): Element => {
return el.children.filter((e) => {e.type === "element"}).at(-1);
};
... I've got error about Type 'ElementContent' is not assignable to type 'Element':
|
Nevermind, I've figured it out! // get last child Element from element's children
const getLastElementChild = (el: Element): Element => {
return el.children.filter((e) => {e.type === "element"}).at(-1) as Element;
}; |
Tomorrow, will fix case when list levels of current and prev elements diff by 2 and more |
Thanks for the work here. Tests pass now but sounds like there is another test case from you last comment? |
@jpoehnelt i'm done! |
Here is my test document: https://docs.google.com/document/d/10foD4QkNSSK48o5_1IJabwZ3twpKC4ZUTKo0VaSMYFE |
* Fix for UL It seems like GoogleDocs API does not set `glyphType` for unordered lists * Fixed nested lists * Fixed case where `el` list level is larger by more than 2 from `last`'s level 878d0bd
@Yankie do you mind sharing your use case for this library. You can email me at jpoehnelt@google.com. Thanks! Looks like 1.0.2 is available on NPM now. |
Sure! Thanks! |
It seems like GoogleDocs API does not set
glyphType
for unordered lists