javalent / dice-roller

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

🐞 Section Roller omit first two rows and adds an empty row #297

Open AwesomeKing17 opened 5 months ago

AwesomeKing17 commented 5 months ago

Check for existing bug reports before submitting.

Expected Behavior

When rolling on a section with this content:

Row 1 Row 2 Row 3 ^table

using the following syntax

dice: [[Section table#^table]]

I expect the roller to randomly display one of the following three results: "Row 1", "Row 2" or "Row 3".

Current behaviour

The roller returns either the result "Row 3" or an empty result.

roller

The tooltip shows that it considers the section to be made up of two rows, the first of which is "Row3". If I add two extra lines at the top of the section, I can work around this, if I re-roll empty results.

Reproduction

Create a note called "Section table" with the following content:

Row 1 Row 2 Row 3 ^table

On a different note, add the following dice roller code:

dice: [[Section table#^table]]

Which Operating Systems are you using?

Obsidian Version Check

1.5.8. and 1.4.16

Plugin Version

10.4.4

Confirmation

Possible solution

No response