Looks fine but still a question: How deep should nesting be possible and is it possible to give an example with 3 levels?
Hello @eddym, I have not intended to make nesting a thing originally, but now that I look at it could be a nice addition. Never tested if it could nest, so it could be buggy.
However you could do something like this for now:
:[
Level 1
Text
:[
Level 2
Text
:[
Level 3
Text
]:
Empty lines in between are needed.
Looks like it can only directly nest on level 2 and deeper, so you won't be able to write anything after the nested spoiler block or add another spoiler block after.
Thanks! I tried even 4 levels and also that worked fabulous.
The empty lines just after the title line and the one just before the final ]: are crucial.
Just one other question but may be beyond your scope:
If I use the MD editor in WYSIWYG mode ALL your beautiful marks disappear 
and one has to edit it all back in the regular editor mode.
It is a bit confusing how to change the css of the spoiler cards in the viewer. I tried updating the userstyle.css it did not work. Then I edited the spoiler-style.css in cache/joplin.plugin.spoiler.cards but that had no effect. Turns out I had to edit the spoiler.js file. I managed to make the spoiler cards prettier.
This the file in case anyone is interested to achieve similar results
spoilers.js (14.8 KB)
I can't get it to work. Am I supposed to rename your spoilers.js file as plugin_joplin.plugin.spoiler.cards.js and then replace previous plugin_joplin.plugin.spoiler.cards.js in the tmp folder? That's what I did, but I see no changes.
Did you restart Joplin?
Yes
Not sure why you are mentioning the tmp folder. Are you sure you replaces the spoiler.js in the cahce folder cache/joplin.plugin.spoiler.cards. I have a portable installation of Joplin so I replace spoiler.js found in this folder: D:\JoplinProfile\cache\joplin.plugin.spoiler.cards
Ah, that was the problem. I had put it in the wrong folder. Now it's working. Thanks. I prefer your style to the default.
Glad I was able to help. Just FYI, I think in the same file there are options that control the way that spoiler card are exported to pdf as well but I did not change those.
hmm quite weird that you were not able to update the style with the userstyle.css as it works for me and it overwrites the base style from the plugin.
I did note in the file that spoiler-style.css is not being loaded when exporting pdf that is why I had to update css within the js file (that's where the css comes from).
If you need to update the way that the cards are being rendered into pdf you can do that with @media print and then use the classes inside.
Changing the style inside the plugin file just seems like such an inconvenient way of editing style  , which is the opposite of what I'm trying to achieve.
 , which is the opposite of what I'm trying to achieve.
Yes it would be ideal to just edit the .css file but that did not work for me whatever i put in the css it gets overriden by whatever is in the .js
Inline spoilers seem to have have no userstyle.css option. I want to hide the body not by a black block. I want to use fancy math fonts with transparent tiny plain text. Am I missing something? Is there a way to set the inline spoiler style? Ideally hiding the inline spoiler just in an icon. Or can I hide selected text another way?
Hi Everyone,
I'm a user of the Spoiler Cards plugin. Thank You for sharing it. I felt the strong need to make a little improvement on it. The obvious disadvantage of this plugin is, one cannot nest one spoiler block into another else at the end with one ending close token. My question was, if it would be possible to implement a computer language like behavior, where each opening token must be equipped with a closing token somewhere behind it.
Thanks to a little improvement, this is easily possible. All what you must do is to count and balance opening and closing tokens. Perhaps you can make the little change, which I send you with this message. Unfortunately I had no luck in creating a patch .. so the changed source should suffice.
Here is a test example of the improved plugin:
And here the improved source with only a few lines changed:
spoilers.js (15.5 KB)
Spoilers.unified.diff (2.9 KB)
Thanks
Mick2nd
Works great, thanks a lot!
would that fix line indent breaks Spoiler Blocks · Issue #11 · martinkorelic/joplin-plugin-spoilers · GitHub as well?
The second bullet point is not part of the block although ]: is after it:




