nalgeon / codapi-js

Interactive code examples for documentation, education and fun.
https://codapi.org
MIT License
496 stars 30 forks source link

docusaurus no longer plays nice with basic editor and newlines #22

Closed srenatus closed 6 months ago

srenatus commented 6 months ago

Hi!

I've been banging my head against using codapi-js with docusaurus. If you see this very basic demonstration on codesandbox.io, and you "browse" to /blog/codapi in the embedded browser, you'll find this:

image

⏬ Clicking on "edit", or clicking into the highlighted code, makes it become this:

image

(I'm aware that it's not set up to actually Run anything, but that's OK, I'm merely worried about the basic editor right now.)

Googling around, I wasn't able to find much; maybe https://github.com/PrismJS/prism/issues/1764 could be related, or maybe not.

Short of using Codejar instead, do you happen to have an idea how this could be made to work?currently

Related to https://github.com/nalgeon/codapi-js/commit/9eb1ea3af21df83fee7716e711d5c5932eb3b736, I believe, since this ferretdb blog post works fine, and uses the previous code (not the textcontent approach)

Thanks for your time 😃

nalgeon commented 6 months ago

Oh boy. I just love Docusaurus. Please see if 0.19.4 fixes the problem for you.

srenatus commented 6 months ago

Yay, thanks for the quick fix 🚀

srenatus commented 6 months ago

I'm afraid I've run into this problem again, using DOM files: It's all going well when referencing Githubissues.

  • Githubissues is a development platform for aggregating issues.