-
-
Notifications
You must be signed in to change notification settings - Fork 38
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
Could the markdown conversion convert unsupported attributes to plain text insead of throwing an error? #405
Comments
@maelchiotti Do you want to propose a PR for this? |
I can make a PR if you think my proposal is good? Something like adding a |
Yes I find it a bit harsh to fail when something is not supported |
Also, we need to decide on a way to handle embeds, maybe simply convert them to |
What do you mean about "converting them to |
I mean when the codec finds an embed, it replaces the embed by the string 'object' or '[object]' This PR could be interesting to support embeds later on #371 |
Oh yeah I see. [object] makes sense I think. Also, horizontal rules could be supported. |
Hi @amantoux, I did some work in #418. I added support for horizontal lines. I added the However I didn't handle objects because I can't test that easily. But I guess in void handleLine(LineNode node) {
if (node.hasBlockEmbed) {
if (node.embedNode.value == BlockEmbed.horizontalRule) {
_writeHorizontalLineTag(buffer);
} else {
buffer.write('[object]');
}
}
...
} |
Is your feature request related to a problem? Please describe.
When using text formatting in the editor that isn't supported in markdown (such as underlining), it breaks the conversion to markdown since the attribute cannot be handled.
Describe the solution you'd like
If you want to keep this behavior, maybe an option could be added to just treat those attributes as plain text? It would allow me to export text even if it has some unsupported markdown in it. This option would be opt-in, and I would handle warning my users.
Describe alternatives you've considered
I don't really know, I could just skip all the notes in my app that cannot be fully converted to markdown, but skipping a huge note just for one underlined word is a shame 😕
The text was updated successfully, but these errors were encountered: