Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author gVectors Team

    (@gvectors-team)

    Hi CliveSoulHeal,

    This is a standard content breaking logic. If we keep HTML tags, e.g. paragraphs, the comment list will be damaged and you’ll see totally mixed layout. For example. comment content is this:

    Text text text <p>text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text text</p>

    If you break it and keep formatting HTML, it becomes this:

    Text text text <p>text text text text text text text text text text text text text text text text text text text text Read More

    As you see the closer </p> tag doesn’t exist, it’ll affect all HTML structure of your comment list. And now imagine this problem with all other tags… The result will be terrible.

    As you may know, WordPress Post excerpt works exactly like wpDiscuz comment excerpt, there is nothing unusual and wrong here. WordPress couldn’t solve this issue and they added “More” ( <!–more–> ) tag in Post editor to allow authors indicate the correct place of breaking. This avoids un-closed HTML tag problems.

    Thread Starter CliveSoulHeal

    (@clivesoulheal)

    Yes, I already knew about this problem, it’s the outcome of lack of foresight!!!

    All you need to do is keep a table of opening tags when the closing part is encountered you delete the opening tag from the table . . . when you reach and display the last word you check what is left in the table and apply the remaining closing tags ‘if’ there are any. That solves any carry over problems.

    I used to write software, so I’m aware of the logic of keeping track of the ‘nested’ elements, and yes, to program the above would take a little more effort BUT that’s what you need to do to have something that works ‘properly / is polished’!!!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘'Read More . . . ' Comment 'Formatting' Problems’ is closed to new replies.