Okay - currently testing a fix - during the quote truncation process it counts the number of code open and code close tags, compares them and if there are more opens than closes, adds a close code tag just in front of the end quote tag.
Other unclosed tags due to truncation are a nuisance but aren't likely to completely trash the rendering.
Works better here... Doesn't mangle the output like before. I think we need to deal with the other unclosed tags when and if we notice them causing any trouble.
Posted by: Dandello Posted on: Oct 23rd, 2014 at 7:23pm
Okay - currently testing a fix - during the quote truncation process it counts the number of code open and code close tags, compares them and if there are more opens than closes, adds a close code tag just in front of the end quote tag.
Other unclosed tags due to truncation are a nuisance but aren't likely to completely trash the rendering.
Posted by: Dandello Posted on: Oct 23rd, 2014 at 5:46am
Okay, I was able to reproduce the problem. What's happening is when a quote is too long, it gets truncated. But if it's quoted code, the end-tag for the code section gets truncated/removed - which tells YaBB it should be rendered.
Basically, we need to write a 'code tag detector' for quotes so that code tags always have end tags.
Posted by: Monni Posted on: Oct 23rd, 2014 at 3:53am
All I can come up with is: if you're quoting code as long as your permitted characters, Yabb may truncate the '[/code]' or other end tags and that can really mess things up. (But I haven't been able to duplicate getting a '$3' rather than text or an error message. That '$3' will come from YaBBC.pm auto-formatting something.)
That $3 most likely comes from the HTML source of the error page it tries to split instead of the simple subject|message|myname it is supposed to split when returning in the ajax callback. It shouldn't replace the message with the error page when using LivePreview, it should just return HTTP error status, return empty message or truncate it.
I can reproduce this every time I try to quote and reply one of the longer patch posts in the HTML 5 section of this forum. It does throw error popup, but does also mess up the LivePreview big time.
Posted by: Dandello Posted on: Oct 22nd, 2014 at 9:25pm
All I can come up with is: if you're quoting code as long as your permitted characters, Yabb may truncate the '[/code]' or other end tags and that can really mess things up. (But I haven't been able to duplicate getting a '$3' rather than text or an error message. That '$3' will come from YaBBC.pm auto-formatting something.)
Posted by: Monni Posted on: Oct 22nd, 2014 at 4:53pm
Preview shows up as "$3" instead of the real quoted text when replying to very long post.
For me is looks like it doesn't escape "|" before sending back...