How do i remove space getting added when using sourceedit in text component | Community
Skip to main content
Level 3
October 16, 2015
Solved

How do i remove space getting added when using sourceedit in text component

  • October 16, 2015
  • 1 reply
  • 954 views

In Text component I have added sourceedit plugin using the below structure
/apps/foundation/components/text/dialog/items/tab1/items/text/rtePlugins/misctools

Now every time i had a tag say 
<footer class="row" > <img src="images/svg/logo-colour.svg" class="logo"><ul class="links"></footer>


It introduces the below spaces
<p> </p>
<p> </p>
<p> </p>
<p> </p>


My question:-

How can this avoided that is adding the below spaces on every time source edit is opened and saved

<p> </p>
<p> </p>
<p> </p>
<p> </p>

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Sham_HC

Currently HTML5 tags like <section>,<header>.. tag in RTE plug-in is not supported. The non working html starting with <P> with html5 blocked elements. So an empty space will be added automatically. Also the html is not well formed and you might see additional issue. Because html preprocessor validates the source and added additional missing tags to meet with rte requirements.

If your authors are well versed with html syntax and need to provide flexible along with html5 syntax then OOB rte might not suit. Below are recommended options to implement at project level[1].

Optionally try with Configure removeSingleParagraphContainer as described at [A]. Attaching snapshot for a quick reference also. [img]Snapshot.png[/img]. Might work for your html trying to implement.

[A]

<htmlRules jcr:primaryType="nt:unstructured">
<blockHandling jcr:primaryType="nt:unstructured" removeSingleParagraphContainer="{Boolean}true"/>

</htmlRules>

[1]

* Build an simple component to insert the html content directly from dialog text input and render it.
* Build a custom WYSIWYG.
* Overlay OOB rte and tweak the htmlProcessor/DomCleanup as per your need.

1 reply

Sham_HC
Sham_HCAccepted solution
Level 10
October 16, 2015

Currently HTML5 tags like <section>,<header>.. tag in RTE plug-in is not supported. The non working html starting with <P> with html5 blocked elements. So an empty space will be added automatically. Also the html is not well formed and you might see additional issue. Because html preprocessor validates the source and added additional missing tags to meet with rte requirements.

If your authors are well versed with html syntax and need to provide flexible along with html5 syntax then OOB rte might not suit. Below are recommended options to implement at project level[1].

Optionally try with Configure removeSingleParagraphContainer as described at [A]. Attaching snapshot for a quick reference also. [img]Snapshot.png[/img]. Might work for your html trying to implement.

[A]

<htmlRules jcr:primaryType="nt:unstructured">
<blockHandling jcr:primaryType="nt:unstructured" removeSingleParagraphContainer="{Boolean}true"/>

</htmlRules>

[1]

* Build an simple component to insert the html content directly from dialog text input and render it.
* Build a custom WYSIWYG.
* Overlay OOB rte and tweak the htmlProcessor/DomCleanup as per your need.