[pLog-svn] wordwrap is broken

Mark Wu markplace at gmail.com
Wed Aug 2 15:59:11 GMT 2006


Maybe we can add a regexp_place modifier  to replace the url to "[link]"
.... You can see the post here http://blog.nlhs.tyc.edu.tw/post/2/53

It is a another possible way to solve this.

Mark

> -----Original Message-----
> From: plog-svn-bounces at devel.lifetype.net 
> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of Jon Daley
> Sent: Wednesday, August 02, 2006 11:42 PM
> To: plog-svn at devel.lifetype.net
> Subject: RE: [pLog-svn] wordwrap is broken
> 
>  	I don't know which is worse, the long urls or text that 
> is chopped in half on just about every line.  I wonder if you 
> could call it twice, something like:
> 
> utf8_wordwrap(utf8_wordwrap($str, $width-10, false), $width, true)
> 
> So, "regular" words wouldn't be cut in half, but only long urls.
> 
> On Wed, 2 Aug 2006, Mark Wu wrote:
> > Now, I see what you said.
> >
> > Mmm...   The original version of utf8_wordwrap only support 
> $break=ture
> >
> > I change it to a better version, it can support $break = 
> true and false..
> > You can found it here
> > http://milianw.de/section:Snippets/content:UTF-8-Wordwrap
> >
> > But, If I set it to false in template, then I can't avoid long url 
> > problem ..... It just break all layout.
> >
> > Mark
> >
> >> -----Original Message-----
> >> From: plog-svn-bounces at devel.lifetype.net
> >> [mailto:plog-svn-bounces at devel.lifetype.net] On Behalf Of Jon Daley
> >> Sent: Wednesday, August 02, 2006 10:29 PM
> >> To: LifeType SVN
> >> Subject: [pLog-svn] wordwrap is broken
> >>
> >>  	See the compile error, but also the wrap field is set 
> incorrectly, 
> >> in my opinion.  This is on:
> >> 
> http://jon.limedaley.com/plog/admin.php?op=editComments&articleId=599
> >>
> >> I guess you are trying to trim long urls so you have $break set to 
> >> true.
> >> I would rather see most people's posts works well.
> >>
> >> Exception message: preg_replace(): Compilation failed:
> >> regular expression too large at offset 0 Error code: 2
> >> -- Backtrace --
> >> /home/jondaley/www/plog/class/template/smarty/plugins/modifier
> >> .utf8_wordwrap.php(39):
> >> preg_replace
> >> /home/jondaley/www/plog/class/template/smarty/plugins/modifier
> >> .utf8_wordwrap.php(26):
> >> utf8_wordwrap
> >> /home/jondaley/www/plog/tmp/1/%%94^940^94065460%%editcomments.
> >> template.php(121):
> >> smarty_modifier_utf8_wordwrap
> >> /home/jondaley/www/plog/class/template/smarty/Smarty.class.php
> >> (1265): include
> >> /home/jondaley/www/plog/class/template/template.class.php(130)
> >> : smarty.fetch
> >> /home/jondaley/www/plog/class/view/admin/admintemplatedview.cl
> >> ass.php(43):
> >> template.fetch
> >> /home/jondaley/www/plog/class/view/admin/adminarticlecommentsl
> >> istview.class.php(135):
> >> admintemplatedview.render
> >> /home/jondaley/www/plog/class/controller/controller.class.php(330):
> >> adminarticlecommentslistview.render
> >> /home/jondaley/www/plog/admin.php(43):
> >> admincontroller.process Well, that was sort of fun. I sele cted a 
> >> dozen characteristics before narrowing them down to six. Altho ugh 
> >> Peter and I had no intersection s at all, I could easily 
> have picke d 
> >> what he did, plus more. So much depends on context. I certainly co 
> >> uld have said "intelligent" but cho se the more-inclusive 
> "able." And 
> >> though I chose "tense" because I se e that aspect of your 
> personality 
> >> a nd think it's important (as is the fact that you fight 
> it), I could 
> >> al so have picked "relaxed" because yo u are more relaxed in your 
> >> reacti ons than most people. As you can g
> >>
> >> _______________________________________________
> >> pLog-svn mailing list
> >> pLog-svn at devel.lifetype.net
> >> http://devel.lifetype.net/mailman/listinfo/plog-svn
> >
> > _______________________________________________
> > pLog-svn mailing list
> > pLog-svn at devel.lifetype.net
> > http://devel.lifetype.net/mailman/listinfo/plog-svn
> >
> 
> --
> Jon Daley
> http://jon.limedaley.com/
> 
> Just be good and kind to your children.  Not only are they 
> the future of the world, they're the ones who can sign you 
> into the home.
> -- Dennis Miller
> _______________________________________________
> pLog-svn mailing list
> pLog-svn at devel.lifetype.net
> http://devel.lifetype.net/mailman/listinfo/plog-svn



More information about the pLog-svn mailing list