PKief / vscode-markdown-checkbox

Get it from the marketplace:
https://marketplace.visualstudio.com/items?itemName=PKief.markdown-checkbox
MIT License
34 stars 11 forks source link

Respect trailing whitespace on toggle #11

Closed gaponcode closed 5 years ago

gaponcode commented 5 years ago

When toggling a checkbox, remaining whitespace not respected and removed. Please note the whitespace on first lines!

This

- [ ] Checkbox  
  This is on second line
- [ ] Checkbox

become this when toggle the first Checkbox

- [ ] Checkbox [2019-03-03]
  This is on second line
- [ ] Checkbox
PKief commented 5 years ago

Hi @gaponcode, thanks for asking, I've never noticed that 😄 Do you expect to have the whitespaces after the date like

- [ ] Checkbox [2019-03-03]          

?

DoCode commented 5 years ago

@PKief I think the best is that always when a date is added or not, it should preserve the whitespace at end of the line for explicit MarkDown linebreaks.

Note: The same 'trimming' is taken, when NO date is added and only the checkbox is toggled! Here the same, the whitespace should be preserved.

Thanks for your fast response! :-)

PKief commented 5 years ago

I changed the behavior to respect the whitespaces at the end of the line. You can find the updated version of this extension on the marketplace 👍