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
Mdx support #29
Comments
MDX support would be cool, but as you said, I'm not sure whether it's possible to do in a good way. I've been experimenting with something fairly similar though - webcomponents. A webcomponent is basically a custom html tag. By using the react component as a web component you should in theory just be able to use the built-in html rendering functionality in obsidian. I have technically added support for webcomponents already, but obsidian uses a whitelist to filter out unknown html tags, and I haven't found a way to add things to the whitelist in the api. |
This issue inspired me to investigate the problem a bit further. Turns out that it's possible to patch the html sanitizer and make it do whatever you want. This actually allows me to replace the regular html rendering with jsx rendering. I should be able to release a new version with this feature this weekend :) |
Ooo that's extremely exciting, this would reallly improve my workflow! Very cool, I'll be looking forward to it! |
I was a bit optimistic with my time. There are some performance issues I want to fix before the next release, but I won't be able to finish that today. Hopefully next week. 🤞 |
I see the appeal of full mdx support. This could be done in two ways.
The former option is problematic because you would lose all normal obsidian functionality, like wikilinks and live preview. I could do the latter thing, but it would be an iterative process where I add one feature at a time. I also can't guarantee that every feature would be possible to implement without breaking some existing obsidian functionality. Regarding |
That makes sense, I've been thinking about making my own (partial) MDX editor using Slate but unifying (heh) the incremental editing of a file with parsing said file in its entirety is kind of hard, notwithstanding MDX parsing just failing if you e.g. leave out a closing bracket. RE: the requirement, that makes sense, would there maybe be an option for it to only scan .mdx files components, and only scan .md files when they have the yaml tag? Now that I think about it this usecase seems a bit too niche to be included, the all-or-nothing approach is probably fine! |
Hi!
Amazing plugin, thank you so much for developing it!
Are you by any chance interested in adding/developing full on MDX support in Obsidian? I feel like this would make the code much more portable as MDX is supported in many places.
Not sure whether this will be possible at all, as some things that work in MD (e.g. html) will break MDX, so you can't really wrap it as a layer around it naively, but would be very cool!
The text was updated successfully, but these errors were encountered: