It's all about the answers!

Ask a question

Could a REGEX wizard please help with removing extra carriage returns?


Glyn Costello (14050) | asked Sep 17 '21, 12:15 p.m.
edited Sep 17 '21, 1:03 p.m.

 I have a section at the beginning of my Module for Glossary Terms which I've embedded in a text artifact. However, when published using RPE, all the DIVs and SPANs create a lot of extra carriage returns. Can anyone suggest some JAvaScript/REGEX that could remove these?


Example content below:
<field:valuefield:type="richtext">
<div>
<div>
<div>
<pdir="ltr"id="_1627564729562">
<span> </span>
<spanclass="com-ibm-rdm-editor-EmbeddedResourceDecorator showContent">
<span>
<div>
<pid="_1627555665830">[MY TEXT 1]</p>
</div>
</div>
</span>
</span>
<span>  </span>
</p>
<pdir="ltr"id="_1627564729563">
<span> </span>
<spanclass="com-ibm-rdm-editor-EmbeddedResourceDecorator showContent">
<span>
<div>
<pid="_1627555650276">[MY TEXT 2]</p>
</div>
</div>
</span>
</span>
<span>  </span>
</p>


Produces:
------

  <o:p> </o:p>

[MY TEXT 1] <o:p> </o:p>

   

  <o:p> </o:p>

  <o:p> </o:p>

-------

Accepted answer


permanent link
Bartosz Chrabski (3.4k22949) | answered Sep 17 '21, 1:22 p.m.

 Glyn,


Do not modify it in the report. There is easier way.

Could you please check the following:

-go in rm/admin >> Advanced Properties

-look for the settings: publish.removePublishSpaceGenerators

-What is its current value?


-If it is set to false, please set it to true, save the modification.


Bartosz

Glyn Costello selected this answer as the correct answer

Comments
1
Glyn Costello commented Sep 20 '21, 4:18 a.m.

Perfect! Spent ages trying to do something myself in REGEX... why isn't this the default? Oh well. 


Thank you! 


Bartosz Chrabski commented Sep 20 '21, 4:51 a.m.

 Yes, indeed good question why isn't this the default. I lost a bit time to find it too.

Your answer


Register or to post your answer.


Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.