abcjs-music / obsidian-plugin-abcjs

Plugin which renders music notations from code blocks
186 stars 14 forks source link

abcjs blocks break Slides core plugin ('presentation mode') #7

Open jakebeamish opened 3 years ago

jakebeamish commented 3 years ago

Choosing 'Start presentation' on a file that does not have any abcjs blocks works as expected. However, when trying to do the same with a file that has abcjs blocks in it, nothing happens. I don't understand if this issue could be with this plugin, or with the core plugin Slides.

TilBlechschmidt commented 3 years ago

It indeed seems to be an issue with the plugin. It attempts to replace the raw code block with the abcjs target node. However, for some unknown reason, this does not work in presentation mode.

Stack trace for future reference:

app.js:1 DOMException: Failed to execute 'replaceChild' on 'Node': The node to be replaced is not a child of this node.
    at MusicPlugin.postprocessor (eval at <anonymous> (app://obsidian.md/app.js:1:615835), <anonymous>:17647:12)
    at Function.t.postProcess (app://obsidian.md/app.js:1:660111)
    at t.<anonymous> (app://obsidian.md/app.js:1:906710)
    at app://obsidian.md/app.js:1:2999
    at Object.next (app://obsidian.md/app.js:1:3104)
    at s (app://obsidian.md/app.js:1:1843)
jakebeamish commented 3 years ago

Thanks for having a look! Sorry I'm pretty incapable when it comes to anything more complicated than a line or two of CSS!

TilBlechschmidt commented 3 years ago

Not to worry, every contribution is welcome even if it is just a bug report or a line of CSS 😉

(I'm not sure when I'll get around to fixing it myself though, my time is rather limited atm)

jakebeamish commented 3 years ago

Understandable, no worries!