Skip to content
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

mconverted Can't handle html Input #408

Closed
sub-hub opened this issue May 6, 2024 · 1 comment
Closed

mconverted Can't handle html Input #408

sub-hub opened this issue May 6, 2024 · 1 comment

Comments

@sub-hub
Copy link
Contributor

sub-hub commented May 6, 2024

data
`<p><span style="font-family:'나눔스퀘어'; line-height:1.5em; font-style:normal;">&quot;Come on, let&#39;s explore more of the park.&quot;</span><em style="font-family:'나눔스퀘어'; line-height:1.5em; font-style:normal;"> Lumi said, her hand still outstretched towards Malek, inviting him to join her on their shared adventure. </em><span style="font-family:'나눔스퀘어'; line-height:1.5em; font-style:normal;">&quot;There&#39;s so much more to see and experience together.&quot;</span></p>\n<p><em style="font-family:'나눔스퀘어'; line-height:1.5em; font-style:normal;">With a teasing glint in her eyes, she added, </em><span style="font-family:'나눔스퀘어'; line-height:1.5em; font-style:normal;">&quot;And maybe we&#39;ll meet a few more ~pretty sisters~ along the way.&quot;</span></p>\n`
mconverted.parse(data)
`<p><span style="font-family:'나눔스퀘어'; line-height:1.5em; font-style:normal;">&quot;Come on, let&#39;s explore more of the park.&quot;</span><em style="font-family:'나눔스퀘어'; line-height:1.5em; font-style:normal;"> Lumi said, her hand still outstretched towards Malek, inviting him to join her on their shared adventure. </em><span style="font-family:'나눔스퀘어'; line-height:1.5em; font-style:normal;">&quot;There&#39;s so much more to see and experience together.&quot;</span></p>\n<p><em style="font-family:'나눔스퀘어'; line-height:1.5em; font-style:normal;">With a teasing glint in her eyes, she added, </em><span style="font-family:'나눔스퀘어'; line-height:1.5em; font-style:normal;">&quot;And maybe we&#39;ll meet a few more ~pretty sisters~ along the way.&quot;</span></p>\n`
data===mconverted.parse(data)
true
mconverted.parse("ll meet a few more ~pretty sisters~ along the way.")
'<p>ll meet a few more <del>pretty sisters</del> along the way.</p>\n'

this is a log of chrome debug console in function ParseMarkdown.
As you can see, If sentence "ll meet a few more ~pretty sisters~ along the way." is in a html tags, ~pretty sisters~ is not convert to markdown.
I guess we need to recursively convert only text content to markdown or find a better library.
I'm sorry, but I don't have time to fix this right now

@sub-hub
Copy link
Contributor Author

sub-hub commented May 6, 2024

I apologize if I only input html as a parameter in my code. Anyway, I've created a new function that takes node as an parameter.
If you don't think it's a real issue, you can close the issue now

@kwaroran kwaroran closed this as completed May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants