vue-markdown icon indicating copy to clipboard operation
vue-markdown copied to clipboard

New line doesn't transform in to <br>

Open avxkim opened this issue 6 years ago • 5 comments

New line \n doesn't transform in to <br>. It outputs as <p>

avxkim avatar Jun 29 '19 07:06 avxkim

Ran into this as well. Nasty bug. Anyone find a workaround?

Edit: Found a workaround. I configured markdown-loader with vue.config.js and injected markdown through v-html. Now it works fine. :)

adi-works avatar Mar 07 '20 20:03 adi-works

@adi518 could you share more details about this workaround please?

samcampisi avatar Jul 23 '20 09:07 samcampisi

Other workaround, use :source and es6 templates... that will preserve white space and work fine.

FossPrime avatar Nov 19 '20 00:11 FossPrime

@samcampisi See: https://github.com/adi518/vue-facebook-login-component/blob/master/packages/docs/vue.config.js

adi-works avatar Nov 19 '20 09:11 adi-works

Yet another workaround...

<!-- whitespace: 'preserve' -->
<vue-markdown>
  - ichi
  - ni
  - san
</vue-markdown>
<!-- whitespace: 'condense' -->

There is probably a way to do this at a higher level

FossPrime avatar Apr 29 '21 12:04 FossPrime