After looking at the HMTL of these pages, I've noticed there are some malformed 'br' tags, i.e. <br>, without the closing slash. I've looked at the HTML for these rich text areas and there isn't any <br> tags inside, so they must be getting inserted between between the RTE and being rendered. Is there a way to handle these tags or will I have to investigate how these are being added (and remove them/form them correctly).
I am also receiving a different error on other pages:
The 'p' start tag on line 18 position 2 does not match the end tag of 'xml'.
The only suspicious HTML I've noticed on these pages are empty 'p' tags, i.e. <p> </p>. Again these aren't visible in the RTE HTML code, just on the page itself.
Whilst I couldn't find out why there were badly formed 'br' tags being outputted from the RTE (I'm guessing this may be an issue with Tiny MCE?), I simply did a .Replace("<br >", "<br/>") on the output of the RTE.
My other tag issue was with 'p' tags. What was actually getting outputted was something like this: "<p><p>Texty texty text text</p>"; An extra opening 'p' tag, without it's closing counterpart. Again I'm not entirely sure why this was happening, but my solution was to to feed the HTML into a HtmlDocument from HtmlAgilityPack, then saving it back out into a string. HtmlAgilityPack magically closes any unclosed tags (I think because it saves it through an XmlWriter which does it for you).
Anyway, that was how I solved my problem! Now on to PDF creation heaven!
'br' start tag does not match end tag of 'p'
Hello,
When using the PDFRazorExample on certain pages (not all), I get the following error:
I have tried adding in a case for 'br' in the master page, and also the Pdf.cshtml, but to no avail:
The page itself has a few rich text areas.
Any ideas? Thanks,
Jamie
Little update:
After looking at the HMTL of these pages, I've noticed there are some malformed 'br' tags, i.e. <br>, without the closing slash. I've looked at the HTML for these rich text areas and there isn't any <br> tags inside, so they must be getting inserted between between the RTE and being rendered. Is there a way to handle these tags or will I have to investigate how these are being added (and remove them/form them correctly).
I am also receiving a different error on other pages:
The only suspicious HTML I've noticed on these pages are empty 'p' tags, i.e. <p> </p>. Again these aren't visible in the RTE HTML code, just on the page itself.
Regards,
Jamie
Hey, any feedback on this issue?
Getting a little urgent now.
Thanks,
Jamie
Hello,
I managed to find a solution:
Whilst I couldn't find out why there were badly formed 'br' tags being outputted from the RTE (I'm guessing this may be an issue with Tiny MCE?), I simply did a .Replace("<br >", "<br/>") on the output of the RTE.
My other tag issue was with 'p' tags. What was actually getting outputted was something like this: "<p><p>Texty texty text text</p>"; An extra opening 'p' tag, without it's closing counterpart. Again I'm not entirely sure why this was happening, but my solution was to to feed the HTML into a HtmlDocument from HtmlAgilityPack, then saving it back out into a string. HtmlAgilityPack magically closes any unclosed tags (I think because it saves it through an XmlWriter which does it for you).
Anyway, that was how I solved my problem! Now on to PDF creation heaven!
Regards,
Jamie
is working on a reply...