Non expected HTML tag closure. [Fixed]

Last post 02-07-2014, 8:50 AM by marvin. 6 replies.
Sort Posts: Previous Next
  •  01-24-2014, 8:03 AM 78827

    Non expected HTML tag closure. [Fixed]

    The problem I'm having right now is very simple, I have the following HTML fragment.

    1. <p class="da-p">Nog een voetnoot
    2.     <footnote>
    3.         <p class="footnote_text"> Tweede voetnoot</p>
    4.     </footnote>
    5. </p>  
    Whenever I load this into the ditor I get this:

    1. <p class="da-p">Nog een voetnootfd<footnote></footnote></p>  
    2. <p class="footnote_text"> Tweede voetnoot</p>  

    How is this caused? And how can this be prevented? 

  •  01-24-2014, 4:11 PM 78829 in reply to 78827

    Re: Non expected HTML tag closure.

    Hi marvin,

     

    I can not reproduce this issue. can you try on demo http://richtexteditor.com/demo/? Do you get the same problem on it?

     

    If the demo works for you too, then I suggest you download the latest build and try again.

     

    Latest build download url: http://richtexteditor.com/download/richtexteditor.rar 

     

    Regards,

     

    Ken 

  •  01-27-2014, 4:33 AM 79840 in reply to 79838

    Re: Non expected HTML tag closure.

    Hi marvin,

     

    What api you used to load the content? Can you create an example which can reproduce this issue and post here? So we can check it.

     

    Regards,

     

    Ken 

  •  01-27-2014, 6:10 AM 79842 in reply to 79840

    Re: Non expected HTML tag closure.

    Hello Ken,

     

    I basically create a html page by processing XML through a XSLCompiledTransform and I serve that by sending the output stream with the right mimetype. After that I load the content into the editor whenever I need it by using SetHTMLCode after making an AJAX get request with jquery.
    I've included the result my api gives:

    1. <?xml version="1.0"?>  
    2. <div xmlns="http://www.w3.org/1999/xhtml" xmlns:rte="urn:conv" id="Document">  
    3.   <h1>Kop 1</h1>  
    4.   <h2>Kop 2</h2>  
    5.   <h3>Kop 3</h3>  
    6.   <h4>Kop 4 </h4>  
    7.   <p> Paragraaf met <b>Bold</b><i>Italic</i><sup>Superscript</sup><sub>Subscript</sub> en <smallcaps>smallcaps</smallcaps>.</p>  
    8.   <captionblock data-type="Tabel"> Tabelbijschrift</captionblock>  
    9.   <table data-frame="none" data-colsep="0" data-rowsep="0" class="none">  
    10.     <tbody>  
    11.       <tr>  
    12.         <td>  
    13.           <p>a</p>  
    14.         </td>  
    15.         <td>  
    16.           <p> </p>  
    17.         </td>  
    18.         <td>  
    19.           <p> </p>  
    20.         </td>  
    21.         <td>  
    22.           <p> </p>  
    23.         </td>  
    24.         <td>  
    25.           <p> </p>  
    26.         </td>  
    27.         <td>  
    28.           <p> </p>  
    29.         </td>  
    30.         <td>  
    31.           <p> </p>  
    32.         </td>  
    33.       </tr>  
    34.       <tr>  
    35.         <td>  
    36.           <p> </p>  
    37.         </td>  
    38.         <td>  
    39.           <p> </p>  
    40.         </td>  
    41.         <td>  
    42.           <p> </p>  
    43.         </td>  
    44.         <td>  
    45.           <p> </p>  
    46.         </td>  
    47.         <td>  
    48.           <p> </p>  
    49.         </td>  
    50.         <td>  
    51.           <p> </p>  
    52.         </td>  
    53.         <td>  
    54.           <p> </p>  
    55.         </td>  
    56.       </tr>  
    57.     </tbody>  
    58.   </table>  
    59.   <p> </p>  
    60.   <captionblock data-type="Figuur"> Afbeeldingbijschrijft</captionblock>  
    61.   <p> </p>  
    62.   <p>Tekst met een voetnoot <footnote><p class="footnote_text"> Voetnoot 1</p></footnote></p>  
    63.   <p>Nog een voetnoot<footnote><p class="footnote_text"> Voetnoot 2</p></footnote></p>  
    64.   <p> asdf  </p>  
    65.   <div data-type="Samenvatting">  
    66.     <p>Kader Samenvatting </p>  
    67.   </div>  
    68.   <p>     <a href="http://www.google.nl">       http://www.google.nl/     </a>   </p>  
    69.   <p>Hiernaast staat een markering  <mark data-value="Markering">Gemarkeerd Item</mark></p>  
    70.   <p> </p>  
    71.   <p> </p>  
    72.   <p> </p>  
    73.   <p> </p>  
    74.   <p> </p>  
    75.   <p> </p>  
    76.   <p> </p>  
    77. </div>  
    Regards,

    Marvin. 

  •  01-27-2014, 9:04 AM 79838 in reply to 78829

    Re: Non expected HTML tag closure.

    Hello Ken,

     

    It works fine when I type in the html, it happens when I load it via my api.
    However when I call the api in my browser I get the html the way I want.

     

    With kind regards,

    Marvin Brouwer. 

  •  01-28-2014, 5:48 AM 79848 in reply to 79838

    Re: Non expected HTML tag closure.

    HI marvin,

     

    I still do not understand which API you used to set content for editor. The Rich TextEditor has "SetText()", "InsertHTML()", "InsertText()" and "PasteHTML()" which can set the content for editor by javascript. Which one you are using?

     

    Regards,

     

    Ken 

  •  02-07-2014, 8:50 AM 79905 in reply to 79848

    Re: Non expected HTML tag closure.

    Kenneth:
     

    HI marvin,

     

    I still do not understand which API you used to set content for editor. The Rich TextEditor has "SetText()", "InsertHTML()", "InsertText()" and "PasteHTML()" which can set the content for editor by javascript. Which one you are using?

     

    Regards,

     

    Ken 

     

    Dear Ken,

    I am using the SetHtmlCode() function. However I must confess I fixed it.
    The problem seemed to be the fact that I returned the HTML mime type.
    I've create a structure which has a <p> element inside a custom element inside a <p> element.
    You'd expect that this wouldn't create any problems especially since I added an XML declaration at the top.
    This is where the problem exists. Every browser tries to parse the HTML as they expect, even though custom elements are allowed in XHTML somehow browsers tend to put their <p> elements outside of non-standard HTML tags.
    To make a long story short, I set the mime type to XML, and insert that into the editor via JavaScript.

    With kind regards,
    Marvin Brouwer.
     

View as RSS news feed in XML