javalent / dice-roller

Inline dice rolling for Obsidian.md
265 stars 27 forks source link

🐞 dice-mod not working with section roller #273

Open rafaelfcsouza opened 8 months ago

rafaelfcsouza commented 8 months ago

Check for existing bug reports before submitting.

Expected Behavior

The command dice-mod: [[Quotes]]|paragraph|noform should replace the content of the note with the roll of a paragraph from the linked document

Current behaviour

The command dice-mod: [[Quotes]]|paragraph|noform replaces the content of the note with ![[Quotes#^dice-avgj]] (another example would be ![[Quotes#^dice-qebt]] where I think the last 4 letters are random)

Reproduction

  1. New note
  2. Create a file Quotes in your Vault
  3. Add a couple of paragraphs to it
  4. Add the dice roll: dice-mod: [[Quotes]]|paragraph|noform, where [[Quotes]] point to the file created in (2)
  5. Execute the roll

Which Operating Systems are you using?

Obsidian Version Check

1.4.16 (Installer 1.3.7)

Plugin Version

10.4.0

Confirmation

Possible solution

No response

chmac commented 7 months ago

I believe this is the expected behaviour. I read that here:

If dice-mod is used on a Section Roller, the plugin will attempt to find a block id for the resulting section, so it can be embedded.

I believe the idea is that instead of copying the text, it instead creates an "embed". That's what I think [[Note^SECTION_ID]] means.

I think the part after the ^ is dice-xxxx because the dice plugin has created those IDs and inserted them into the note.

I don't see any option to disable this embedding behaviour and instead copy the contents of the text.