• Hello,

    if I insert html-code in the text editor, the editor changes the html-code and inserts tags. For example a p-tag in a list with a second list in one list-element.
    This is the code, I insert:

    <ol>
     <li>Lorem ipsum dolor sit amet:
         <ul>
    	<li>wLorem ipsum dolor sit amet</li>
    	<li>Lorem ipsum dolor sit amet</li>
    	<li>Lorem ipsum dolor sit amet</li>
         </ul>Nun kann man entscheiden:</li>
      <li>Lorem ipsum dolor sit amet</li>
      <li>Lorem ipsum dolor sit amet</li>
      <li>Lorem ipsum dolor sit amet</li>
      <li>Lorem ipsum dolor sit amet</li>
    </ol>

    And this is, what I get in the Frontend (the p-tag is at the end of the unordered list):

    <ol>
      <li>Lorem ipsum dolor sit amet:
        <ul>
            <li>Lorem ipsum dolor sit amet</li>
            <li>Lorem ipsum dolor sit amet</li>
            <li>Lorem ipsum dolor sit amet</li>
         </ul>
        <p>Lorem ipsum dolor sit amet:</p></li>
      <li>Lorem ipsum dolor sit amet.</li>
      <li>Lorem ipsum dolor sit amet</li>
      <li>Lorem ipsum dolor sit amet</li>
      <li>Lorem ipsum dolor sit amet</li>
    </ol>

    I’ve disabled the rich-text editor for my profile, to prevent this problems, but this doesn’t solves them.
    Searching in the web doesn’t help, because I only find the tip, to disable the rich text editor.

    Greets
    Paka

Viewing 3 replies - 1 through 3 (of 3 total)
  • That is because you did not start the first LI element after closing the nested unordered list.

    <ol>
     <li>Lorem ipsum dolor sit amet:
         <ul>
    	<li>wLorem ipsum dolor sit amet</li>
    	<li>Lorem ipsum dolor sit amet</li>
    	<li>Lorem ipsum dolor sit amet</li>
        </ul>Nun kann man entscheiden:</li><!---HERE--->
      <li>Lorem ipsum dolor sit amet</li>
      <li>Lorem ipsum dolor sit amet</li>
      <li>Lorem ipsum dolor sit amet</li>
      <li>Lorem ipsum dolor sit amet</li>
    </ol>

    Would need to be

    <ol>
     <li>Lorem ipsum dolor sit amet:
         <ul>
    	<li>wLorem ipsum dolor sit amet</li>
    	<li>Lorem ipsum dolor sit amet</li>
    	<li>Lorem ipsum dolor sit amet</li>
         <!--Here---></ul>
      <li>Nun kann man entscheiden:</li><!---AND HERE--->
      <li>Lorem ipsum dolor sit amet</li>
      <li>Lorem ipsum dolor sit amet</li>
      <li>Lorem ipsum dolor sit amet</li>
      <li>Lorem ipsum dolor sit amet</li>
    </ol>

    you go straight from the close ul tag to the content of the li (without opening the li) and then you closed an unopened ll…since there was no tag before the content, wordpress treated it like a paragraph.

    Thread Starter paka

    (@paka)

    Hello Endlyss,

    thanks for the quick answer.
    The text before the ul-list, the whole ul-list and the last sentence after the ul-list are in one li-element of the ordered list.

    <!-- here I open the li-element--><li>Lorem ipsum dolor sit amet:
         <ul>
    	<li>wLorem ipsum dolor sit amet</li>
    	<li>Lorem ipsum dolor sit amet</li>
    	<li>Lorem ipsum dolor sit amet</li>
        </ul>Nun kann man entscheiden:</li><!---And here it is closed--->

    And a ul-element is alowed as a child of a li-element inside a list. The text at the page wouldn’t make any sense, if I insert this sentence in a new li-element.
    The code I posted is only one expmple. I recive this behaivior several times, and I’ve always looked for a workaround, to make the output look ok, but this can’t be the solution.

    Greets Paka

    Oh, my apologies…I missed the opening above and jumped to the wrong conclusion.

    For the wordpress formatting it with the <p> tag, that can be disabled with a remove_filter function

    I would try adding:

    remove_filter( 'the_content', 'wpautop' );

    to your functions.php

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Text editor changes html, Rich-text disabled’ is closed to new replies.