• Resolved nethubdesign

    (@nethubdesign)


    Hi, I found that the span tag is stripped in SiteOrigin Editor after I save the page.

    After I save the page, the span tag works in front-end. However, the span tag is stripped in the backend when I open SiteOrigin Editor to check again.

    Below is the HTML code before I save.

    <ul class="fa-ul feature">
     	<li><span class="fa-li"><i class="fas fa-check"></i></span>test1</li>
     	<li><span class="fa-li"><i class="fas fa-check"></i></span>test2</li>
    </ul>

    Below is the HTML code after I save.

    <ul class="fa-ul feature">
     	<li><i class="fas fa-check"></i>test1</li>
     	<li><i class="fas fa-check"></i>test2</li>
    </ul>

    Is there anyway to fix this problem?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Contributor alexgso

    (@alexgso)

    Hi,

    TinyMCE, the editor WordPress uses and by extension the SiteOrigin Editor widget uses, tends to strip any HTML that’s “empty” in terms of content. To avoid this, try adding   inside of the span to see if that helps.

    <li><span class="fa-li">&nbsp;<i class="fas fa-check"></i></span>test1</li>

    Kind regards,
    Alex

    Thread Starter nethubdesign

    (@nethubdesign)

    Hi,

    I have tried your suggestion to add &nbsp inside of the span tag. After I save, the span tag is not stripped, but it shows a ” ” (space) instead of &nbsp in the span tag.

    If I do not change ” ” (space) to &nbsp in the span tag and save again, the span tag will be still stripped after save.

    Do you have other way to fix this problem completely?

    Plugin Contributor alexgso

    (@alexgso)

    Hi,

    Thanks for trying. Unfortunately, TinyMCE requires there to be a space present to not strip out the span. This isn’t something we’re able to override as it’s how TinyMCE handles spacing/elements, and it’s how it’s handled in WordPress overall – it’s not specific to the SiteOrigin Editor widget.

    I recommend adding the HTML using a Custom HTML widget as that widget doesn’t use TinyMCE so your HTML won’t be modified.

    Kind regards,
    Alex

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Span stripping in SiteOrigin Editor’ is closed to new replies.