chmln / vue-wysiwyg

A lightweight WYSIWYG HTML editor for Vue.js
https://chmln.github.io/vue-wysiwyg/
MIT License
555 stars 134 forks source link

Replace <div> wrapping with <p> #75

Closed Konzeptcode closed 5 years ago

Konzeptcode commented 5 years ago

Hi, is it possible to disable the

wrapping of the plugin for new lines and replace them with

?

Current: <div>dfgsdgfsg</div><div>bvxdgbydipoj<b>dübj</b>d</div><div>cvnbcncvncvncv</div>

Aiming: <p>dfgsdgfsg</p><p>bvxdgbydipoj<b>dübj</b>d</p><p>cvnbcncvncvncv</p>

itsyub commented 5 years ago

you can do it by specifying paragraphSeparator config.

Sample code

import wysiwyg from "vue-wysiwyg";
Vue.use(wysiwyg, {paragraphSeparator: 'p'}); 
ZachitZo commented 3 years ago

It works, but first stroke of handle input text have not wrap. Only next paragraphs start to wrap, first - not!