javalent / dice-roller

Inline dice rolling for Obsidian.md
268 stars 28 forks source link

🐞 Table Roller displays value from wrong column if there are empty cells in a table #270

Open simonvanbernem opened 10 months ago

simonvanbernem commented 10 months ago

Check for existing bug reports before submitting.

Expected Behavior

When using the following expression, a random value from the B-column from the table marked with ^test-table in the note Namen should be picked and displayed

`dice: [[Namen#^test-table]]|B`

Current behaviour

For the table given in the reproduction section, a value from column C will be picked instead:

grafik

If the empty cells in the given table are filled, a value from column B is picked instead. So in this case, the behavior is correct.

Reproduction

Placed in note Namen:

| A   | B   | C   |
| --- | --- | --- |
| aa  | ba  | ca  |
| ab  |     | cb  |
| ac  |     | cc  |
| ad  |     | cd  |
| ae  |     | ce  | ^test-table

Which Operating Systems are you using?

Obsidian Version Check

1.4.16 and 1.4.13

Plugin Version

10.3.0

Confirmation

Possible solution

No response