-
Notifications
You must be signed in to change notification settings - Fork 60
Issues/#68 #144
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
base: main
Are you sure you want to change the base?
Issues/#68 #144
Conversation
|
|
||
| for (const li of liElements) { | ||
| let content = ''; | ||
| let meta = {}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta is always empty.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for alerting me, i did the adjustments, however it was always empty on pasted content due to other reason mentinoed in PR #145 and you can see that below in the output data shown in the screenshot below:

neSpecc
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the fix. Could you explain the exact problem and prepare the smallest significant change without rewriting the existing code? Thus we can review it faster.
I sincerely apologize for for the late reply, i got busy 😅. So, I had to rewrite that piece of code for a couple of reasons, i have explained the core of the problem in the description, but to explain even more, the issue cause resides mainly in 2 parts that i will discuss below. 1. how we set the content of each child element in case of nested elementtaking into account the following code snippet; public pasteHandler(element: PasteEvent['detail']['data']): ListData {
...
// get text content of the li element.
const content = child.innerHTML ?? '';
...
}this return the content of the element AND it's descendants as documented by MDN and shown below:
so this will create an output that looks like the below: 2. how we operate on the pasted content
Result
I hope i was able to provide a comprehensive explanation this time, please let me know if there is any wrong info or misunderstanding, i'm new to open-source contributions 😅 |
|
@neSpecc hello, any updates? |




Issue
#68
Issue Cause
The old implementation did not operate directly on the pasted element and instead relied on the querySelectors for identifying lists and list items through getting only the direct children of the root element on each recursive iteration resulting into an empty array on nested lists and rendering the content through innerHTML, which sometimes created viusally incorrect lists and broken clean data ignoring formatting nested lists when
onsaveis fired.Issue Fix workflow
moved the new logic into a separate funciton and implemented new flow that operates directly on the pasted content, making sure that if the pasted content contains mixed lists, it perserves the list style of the root element, yet renderes correct clean data output