WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: TinyMCEComments] Formatting issue (3 posts)

  1. silverks
    Member
    Posted 4 years ago #

    Hi there,

    I've been using the TinyMCEcomment plugin for quite some time. It has been working great and looks even better on my blog with self-made theme.

    However, the only problem is that whenever somebody submitted a comment, new paragraphs (hitting Enter once and not Shift + Enter) in the comment become line breaks instead. Also, lists become line breaks as well.

    Any help would be greatly appreciated. My blog is at http://www.khairul-syahir.com, if that would help.

  2. silverks
    Member
    Posted 3 years ago #

    I found out that the above issue is because WordPress automatically strip all HTMLs from the comment, including all the <p>,

      ,
        , etc.

        I noticed this as when I'm logged in and post the comment, all the html tags were included in the comment (and I notice the _wp_unfiltered_html hidden input in the form).

        Question is, how do I get the same functionality for non-logged-in users? I know allowing full unfiltered html comment could be dangerous, but at least allow the standard tags (like the one here in WordPress support) through?

        Please if someone can help me. Thanks.

  3. silverks
    Member
    Posted 3 years ago #

    ok, i've resolved this issue already. It seems like the kses filter is stripping out all html tags, even the usual ones.

    I replaced the kses filter with HTML Purifier using HTML Purified plugin, and everything works fine.

    HTML Purifier is supposed to be the better sanitizer, but it is also more resource-intensive. But since I haven't noticed any performance hit on my website, and also the sanitizer will only be invoked when saving posts and submitting comments, it's a good enough solution.

    Maybe WP developers should implement a better HTML sanitizer than kses? even htmLawed seems to be better...

Topic Closed

This topic has been closed to new replies.

About this Topic