Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Best way to process bootstrap-wysihtml5 output

Im using the bootstrap-wysihtml5 rich text editor bootstrap-wysihtml5 which basically works as expected. However, I was wondering what would be the best approach to process the generated HTML output for inclusion into the DOM tree. The issue is that normal text input comes without a tag whereas all the other tags (h1, h2, ul, etc. are provided) which makes it difficult to take the output straight away.

Is there a way to avoid any additional processing? Or am I just missing the p-tags somewhere?

like image 219
tomw Avatar asked Nov 13 '22 01:11

tomw


1 Answers

For anybody finding here later (April 2015, Version 0.4.17): Just use the option

useLineBreaks : false

false means, every paragraph is properly and initially surrounded by <p>...</p>. Block commands are applied to that <p>.

true means, there is no initial <p>...</p> and block commands embrace with some <div>...</div> and more.

like image 159
peter_the_oak Avatar answered Nov 15 '22 12:11

peter_the_oak