Ebonsignori / obsidian-at-symbol-linking

Adds ability to link with @ in Obsidian. Can limit @ linking to specific folders e.g. People/
MIT License
60 stars 9 forks source link

[Bug] @ names will not trigger in Admonition callouts because they are treated as normal code blocks #30

Open bluecav opened 7 months ago

bluecav commented 7 months ago

Describe the bug I use Admonition callouts because I find the code block construct easier to manage than the native callouts with the > prefix. Copying and pasting text is easier without the >.

If I use an Admonition block for a callout though, any @names within the callout will not trigger the plugin. This does not happen in traditional callouts. My suspicion was that since Admonition uses code block backticks for the block content, this made the plugin not want to trigger because it thinks it's within a code block.

I haven't looked at Obsidian based code before, but I noticed in one of the files references to an isInCodeBlock variable and a comment indicating the popup would not trigger within a code block by design.

Given the conflict, is there a way to differentiate an Admonition block from a normal code block? If not perhaps an enhancement option to allow triggering within code blocks would suffice.

To Reproduce Steps to reproduce the behavior:

  1. Add the Admonition plugin
  2. Create an Admonition
  3. Within the callout, type an @name reference
  4. It will be treated as plaintext

Expected behavior Trigger within the block as if it were in a normal callout

Screenshots If applicable, add screenshots to help explain your problem. IMG_0100 IMG_0101