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

Suggestion for improving reliablility and exensibility #19

Open
stephenafamo opened this issue May 16, 2021 · 2 comments
Open

Suggestion for improving reliablility and exensibility #19

stephenafamo opened this issue May 16, 2021 · 2 comments

Comments

@stephenafamo
Copy link
Contributor

I've been thinking that perhaps we can use goldmark's AST as a middleground for converting HTML to MD.

I've been working on converting a different format into markdown, this method has been quite smooth as far as I can parse to AST correctly.

I was thinking that we could do a similar thing for HTML. Bonus point is that it'll make it easier to extend and support many markdown flavours and extensions. GFM is already covered.

This will likely be a breaking change since something like setting custom options will no longer work the same way.

If you think it makes sense I could work on it once I have less work on my hands.

@mattn
Copy link
Owner

mattn commented May 16, 2021

Thanks your suggestion. I'm not good for the "different format". What the use-case?

@stephenafamo
Copy link
Contributor Author

I just think that first converting into an intermediate format makes things cleaner and more reliable, it'll also eliminate a number of weird edge cases.

I have some experience working with goldmark so I know it is quite nicely designed and works pretty well.

I got the idea because I was converting from prosemirror to markdown and back and it works quite seamlessly. I think doing the same for HTML may provide cleaner results.

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