• Hello,

    This question concerns my wordpress blog even if it is not strictly WP related, I hope it’s OK to ask it here ??

    Simply said, it may happen that I forget to close an html tag in my blog, or close it incorrectly (for instance, the Visual Editor replaces i with em but when I do manual edits I usually still close it with an /i instead of the required /em).
    And when that happens, the unclosed tag will affect my whole blog, below posts, sidebar and footer.

    I wonder, would there be a “magical” trick to force the closing of all html tags at the end of a blog post ?

    I suppose I could forcibly add my single.php page a line with closing codes for all the usual tags ( /i /em /a /b /strong /u /ul /font /span, etcetera), but it wouldn’t be a very clean code in the end.

    Thanks if you can help with the solution, please save my blog from having unclean code added to my single.php ! ??

    Sabinou

Viewing 2 replies - 1 through 2 (of 2 total)
  • WP already attempts to close unclosed tags, and does a better than bad job of it. Not to criticize WP though. You are asking for an extremely complicated function. There must be thousands of ways to make a mess of the tags and thousands of valid ways to close them. In a sense, you are asking the software to guess your intentions, and that is asking a lot.

    Thread Starter sabinou

    (@sabinou)

    I agree, this is a very complicated request.

    This is why I didn’t say it was specifically based on wordpress. I hoped – why, I still hope, no use so far for past tense ! – the html or php languages may contain an order to close all formatting tags.

    I learned html over the years, never from the book but from practice, that makes me very humble, but it’s true it may make me also far too optimistic about potential functions I haven’t witnessed so far :-/

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘HTML question : any way to force the closure of open tags ?’ is closed to new replies.