chhoumann / quickadd

QuickAdd for Obsidian
https://quickadd.obsidian.guide
MIT License
1.46k stars 136 forks source link

[BUG] logic error when adding items to the end of sections with table hyphens #365

Open LumenYoung opened 1 year ago

LumenYoung commented 1 year ago

Describe the bug A clear and concise description of what the bug is.

The quickadd will be confused when there are 3 hyphens in the table.

example table is below.

| Price | Account | receiver | Name      |
| ---- | ---- | ---- | --------- |
| 22   | boc  | rstr | breakfast |
| 45   | boc  | rstr | lunch     |

To Reproduce

  1. Create a quickadd to insert some text into the section end, and in the section is having a table like above
  2. Try to insert

Here is my example setup image

Expected behavior The text should be inserted at the table end. However the text would be added before the |---|---| section.

Additional context Add any other context about the problem here.

I think the problem is that the quickadd think the hyphen in the table is a seperator that ends the section. Because my temporary workaround is to reduce the number of hyphens down to 2 like below

| Price | Account | receiver | Name      |
| -- | -- | -- | -- |
| 22   | boc  | rstr | breakfast |
| 45   | boc  | rstr | lunch     |

BTW, thank you for your wonderful plugin!

kenlefeb commented 1 year ago

I just ran into this exact issue, myself. I keep my daily journal in a table, not a bulleted list, so I'm excited to see this one resolved. :)

I just discovered QuickAdd today, and I'm really eager to start using it: I'm sure I will use it all the time! Thanks for building this plugin!