dendron icon indicating copy to clipboard operation
dendron copied to clipboard

Add option to create Line Break on single Carriage Return

Open andrey-jef opened this issue 3 years ago • 4 comments

Please select if your request is either something new or an enhancement

  • [ ] Enhancement of an existing Feature.
  • [x] Request of a new feature.

Please select the area your request applies to. (Multiple selections are possible)

  • [ ] Onboard. Initial vault setup and import/export pods
  • [ ] Create. Note creation, lookup, snippets and templates
  • [ ] Retrieve. Backlinks, references, graph view
  • [ ] Structure. Refactoring, multi-vault and schemas
  • [x] Publish. Sharing your repo with the world
  • [x] Misc (Choose this if your not sure)

Is your feature request related to a problem? Please describe

Currently in a markdown note, the required syntax to create line break is

  • using two consecutive clicks Enter
  • using <br> tag
  • using at least two trailing whitespaces following by a carriage return

Then the command Dendron: Show Preview or Dendron: Site Build will parse that syntax to a line break.

Describe the solution you'd like

Please consider to implement an option in settings to Enable Line Break on single Carriage Return when parsing with command Dendron: Show Preview or Dendron: Site Build

Describe alternatives you've considered

Nothing

Additional context

Nothing

andrey-jef avatar Oct 27 '21 22:10 andrey-jef

Thanks @andrey-jef for the suggestion. It seems like most markdown renderers (including VS Code's built in one) have consistent behavior with needing the extra line break as well. We can take a look at whether it'd be cheap to add a config to the rendering logic for this.

If you had this setting, would you expect/want these two to render the same? Samples below are what would be in the editor

hello
world

and

hello

world

jonathanyeung avatar Oct 28 '21 09:10 jonathanyeung

Thanks @andrey-jef for the suggestion. It seems like most markdown renderers (including VS Code's built in one) have consistent behavior with needing the extra line break as well. We can take a look at whether it'd be cheap to add a config to the rendering logic for this.

I have this suggestion since I also use Obsidian and this is its default behavior when rendering line break. I'd respect Dendron's consideration.

If you had this setting, would you expect/want these two to render the same? Samples below are what would be in the editor


hello

world

and


hello



world

Hmm, I expect these 2 examples should be rendered identically

Hello`CR`
`CR`
World
Hello`CR`
World

andrey-jef avatar Oct 28 '21 11:10 andrey-jef

I'm also an Obsidian user and think this feature would greatly enhance the usability of Dendron for writing. I think when creating a single link break using Enter it should be rendered the same way as it is currently the case for two trailing spaces. It is not really intuitive if I as a user need to know to use two spaces or <br> in order to create a regular line break in my document (one without a large gap between the two lines).

TBiele avatar May 19 '22 14:05 TBiele

VSC gives an option for previews : "Enable Line Break on single Carriage Return" press Enter, you have a new break line, easy. Can help new markdown users. More easy to take notes if I dont have to add \ or at end of every lines ! Thanks for all

bonnebulle avatar Aug 31 '23 15:08 bonnebulle