Search code examples
angularjseditortextangular

Display empty <p> with TextAngular at render


Is there an easy way to keep empty <p> visible in wysiwyg when using TextAngular?

If the string is <h1>test</h1><p></p><p></p><h2>subtitle</h2>, when the page render and the content is passed to TextAngular, the HTML source code has all tags, but the wysiwyg doesn't show them.

Did I miss something? Thanks

Edit: here is a fiddle to demonstrate


Solution

  • It's not an elegant solution, but you can parse your html string and add &nbsp; to your empty tags.

    this.html = "<h1>Test</h1><p>&nbsp;</p><p>&nbsp;</p><h2>Test</h2>";