[ php-blog-Bugs-1530425 ] BBCode displayed in recent comment sidebar

"SourceForge.net" <[email protected]> Thu, 15 May 2008 11:08:16 -0700
Newsgroups gmane.comp.serendipity.trackers
Message-ID <[email protected]>
Bugs item #1530425, was opened at 2006-07-28 10:36
Message generated for change (Comment added) made by slothman
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=542822&aid=1530425&group_id=75065

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Plugins
Group: None
Status: Open
Resolution: None
>Priority: 3
Private: No
Submitted By: Jude Anthony (slothman)
Assigned to: Jude Anthony (slothman)
Summary: BBCode displayed in recent comment sidebar

Initial Comment:
BBCode is displayed in the recent comments sidebar.

reference sites:
http://myspace.com/coreylafferty
http://myspace.com/actofbetrayal

<a href="http://nopaste.php-q.net/227841">Modified
Plugin, handles first bbcode</a>

Forum link: <a
href="http://www.s9y.org/forums/viewtopic.php?t=6075&postdays=0&postorder=asc&start=0>forum</a>

----------------------------------------------------------------------

>Comment By: Jude Anthony (slothman)
Date: 2008-05-15 14:08

Message:
Logged In: YES 
user_id=228551
Originator: YES

Perhaps we could include a new event hook, 'remove_markup', that can be
called to remove all instances of markup from its input, leaving only plain
text.  Then we could truncate with impunity.

----------------------------------------------------------------------

Comment By: Garvin Hicking (garvinhicking)
Date: 2007-05-28 11:37

Message:
Logged In: YES 
user_id=473563
Originator: NO

But exactly that is the problem, we need to prevent that people can break
the layout with overlong comments. That can definitely happen, and was the
reason why wordwrap() was used.

So, yes: It matters. :-)

The problem is that we already have many themes were 'overflow: scroll'
(or hidden) would need to be added, so it's not a real solution we can
offer to existing blog owners. I do see that the current position is also
problematic, but with that way we would only make it better for few people,
and would break more layouts with overlong words. In the current situation
the worst thing that can happen is that BBCode does not get parsed, which
is IMHO not as bad as if a whole layout would be broken.

What I want to say is, I can't see any good/workable solution at this
point for all parties involved, which is part of the reason why no change
has been made yet to the plugin. :-(

----------------------------------------------------------------------

Comment By: Lars Becker (lbecker)
Date: 2007-05-28 11:27

Message:
Logged In: YES 
user_id=1711351
Originator: NO

At the time being it is not possible to split a word with CSS. But I doubt
that
it would be necessary: even in languages with long words like german
strings are
seldom so long, that they do not fit into a reasonably sized side bard.
Does it
really matter if strings like "hahahahahahahahaaaaaaaaaa" are getting
truncated?
Of course of done no empirical research, but i'm quite sure that in most
cases only
urls and utterings like hahahahahahaaaaaaa will get truncated, which means
little
loss semantically.

I think "overflow: hidden" is a working solution and if it's not one could
use 
"overflow: scroll". There also would be the possibility to handle this
problem 
with dom scripting. But the currently implementation works rather randomly
and results
in many split words.

The last time i looked into the css3 working papers there was also a
planned
text-wrap attribute that would solve this problem. As far as I know it's
currently not implemented in any browser. But I think we can have good
hope that
in some not so distant day we will have the opportunity to solve this
problem
with CSS entirely.

Regarding the open tag problem: you're probably right. If one do not want
to
rely on libtidy (which we probably won't) this won't be simple and quickly
done.

regards
Lars


----------------------------------------------------------------------

Comment By: Garvin Hicking (garvinhicking)
Date: 2007-05-28 10:21

Message:
Logged In: YES 
user_id=473563
Originator: NO

Yes, if templates COULD handle it, that would be best. But the hard
linewraps need to be done in PHP scope, they cannot be achieved via CSS. If
you think they can, please provide the code how "hahahahahahahahaaaaaaaaaa"
would be split WITHOUT using a scrollbar. That would be most appreciated,
because I do not know about such a solution.

The problem is even if special markup is trimmed, it gets converted to
HTML, which would still be split. It's very hard to ensure that an opened
tag is always closed, because if I prepend "[B]" before a 200kb comment,
and at the end use "[/B]" I would have to emit the whole code to get the
ending string.

----------------------------------------------------------------------

Comment By: Lars Becker (lbecker)
Date: 2007-05-28 09:46

Message:
Logged In: YES 
user_id=1711351
Originator: NO

If the main reason is to preserve the layout i think handling of overflows
should be in the domain of the templates not in the domain of program
logic. We have the ability to do this with css which has none of the
unwanted sideeffects the current implementation has.

The only remaining problem then would be the handling of markup at the end
of strings, that still get cut. Maybe parsing special markup should occur
before trimming the strings?

----------------------------------------------------------------------

Comment By: Garvin Hicking (garvinhicking)
Date: 2007-05-28 08:33

Message:
Logged In: YES 
user_id=473563
Originator: NO

Hi!

The main reason is, that the comment sidebar plugin needs to ensure that
lines are cut after X characters (using wordwrap() PHP function). We need
to force cutting, because otherwise the sidebar can be broken by user
comments like "hahaaaaaaaaaaaaaaaaaaaaahahaaaaaaaaaaaaaaaaaaaahahaha",
which is of course what we need to prevent in first instance.

Because of this cutting, it can happen that a [bbcode] instance is broken
in the middle, and because of that, the bbcode markup cannot be applied.

Some people prevent the wordwrapping bug by setting the wordwrap number to
"999999" and then using CSS and "overflow: hidden" as well as a "width"
property in the templates Stylesheet. So if you don't see a need in hard
linebreaks, you can use that method.

HTH,
Garvin

----------------------------------------------------------------------

Comment By: Lars Becker (lbecker)
Date: 2007-05-28 08:29

Message:
Logged In: YES 
user_id=1711351
Originator: NO

Hi Garvin,

before I reported the bug i took a short look into the relevant code, so
i'm aware that it is not as simple as it seems. I would have fixed it by
myself. The question i have is: what's the reason for cutting the strings.
I see no use in hard linebreaks. To me it seems they are causing trouble
but have no true benefit. It's not only BBCode that gets broken by it.
Normal text is sometimes also broken in the midst of a word.

best regards
Lars

----------------------------------------------------------------------

Comment By: Garvin Hicking (garvinhicking)
Date: 2007-05-28 07:47

Message:
Logged In: YES 
user_id=473563
Originator: NO

Hi lbecker,

sadly BBCode truncating is not as trivial as it seems (read the mentioned
URLs in the original tracker item), so there hasn't been progress on this.

Actually, I don't think this can really be resolved. Whenever you cut
strings in a hard way to force linebreaks in the browser, you cannot be
sure to not truncate bbcode or HTML in the middle without really
performanse intensive parsing.

----------------------------------------------------------------------

Comment By: Lars Becker (lbecker)
Date: 2007-05-27 08:37

Message:
Logged In: YES 
user_id=1711351
Originator: NO

Are there any updates on this? I experience the same problems with BBCode
which are somewhat annoying since "BBCode" and "recent comments" both are
core plugins of s9y. 

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=542822&aid=1530425&group_id=75065

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft 
Defy all challenges. Microsoft(R) Visual Studio 2008. 
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/