logonoff / obsidian-inline-spoilers

Adds Discord-like syntax for inline spoilers.
https://obsidian.md/plugins?search=Inline%20spoilers
GNU General Public License v3.0
8 stars 0 forks source link

Bug: Spoiler does not apply when note link within spoiler section #4

Closed QuestionQuest117 closed 1 week ago

QuestionQuest117 commented 2 weeks ago

I found that when you try to mark a section of text as a spoiler that contains the [[note]] form of link, the text does not get hidden.

I copied some text from a source and applied the spoiler to a section of that text (possible spoilers for a Pathfinder campaign I don't want to remember as a player). It worked as intended. I then used an additional community plugin called Note Linker to search the note for key words to be linked to existing notes. It found a word within the spoiler section to be hyperlinked. I noticed that the linked word was visible through the spoiler cover, but didn't particularly mind given there was no context to the word that spoiled it. I continued to work around the relevant text as well as switched to and from read mode and found that the spoiler was no longer working in either view (I did have the experimental spoiler in editor enabled).

I tried disabling and re-enabling the spoilers plugin, I tried reloading it, I tried uninstalling and reinstalling it, I tried toggling read mode multiple times and reapplied the spoiler to the text section multiple times, I tried disabling a re-enabling the experimental spoiler in editor setting and none of it worked. I then removed the link on the word, and found the spoiler worked again. I re-added the link to the word and the spoiler stopped working. I applied spoilers to the text around the link and it covered that text.

Version Inline Spoilers 1.1.1 Version Obsidian 1.7.5 image

image

Now with the experimental hide in editor disabled: image

image

And here is the current workaround which I'm not exactly pleased with: image

Proof that once you remove the brackets for the link, it works again: image

logonoff commented 2 weeks ago

Please provide the markdown for testing

QuestionQuest117 commented 2 weeks ago

Please clarify? I'm sorry, but I don't understand what you mean. Do you mean a copy of the exact text in question?

If so:

The churches of Cayden Cailean, Desna, Calistria, and Gorum are the most common, although Norgorber, the god of murder, thievery, and secrets is also popular. ||Additionally, cults of two gods forbidden throughout [[Avistan]] and Garund have found the region to be a safe haven: Hanspur and Gyronna.|| The region also attracts strange cults in the same way they attract strange people, and small religions ranging from the unorthodox to the downright bizarre make their home here.

Kalendula16 commented 1 week ago

+1 It would be great if you could fix this in the next update.

Kalendula16 commented 1 week ago

There are a lot of links in my notes, and if I can't hide the text with links, then, unfortunately, it doesn't make sense for me to use this plugin.😞

logonoff commented 1 week ago

Fixed in 1.1.2 when using this workaround:

||Text before the link ||[||link||](https://google.com)|| text after the link|| 

Unfortunately, your spoilers will have to be split up due to how the syntax is parsed, I'd appreciate any contributions for a potential fix.