milesj / decoda

A lightweight lexical string parser for BBCode styled markup.
MIT License
196 stars 52 forks source link

Add [abbr] support #24

Closed remontees closed 12 years ago

remontees commented 12 years ago

Hello,

It could be good to add the BBCode [abbr] for acronyms to the library.

remontees

milesj commented 12 years ago

So something like this? [abbr="National Aeronautics and Space Administration"]NASA[/abbr]

remontees commented 12 years ago

Yes !!! It will be so great !

milesj commented 12 years ago

Added in 4.0.2!

remontees commented 12 years ago

This not works : [abbr="SATAaaa"]SATA[/abbr] It can't parse SATAaaa of title attribute. It's the balise's objective...

milesj commented 12 years ago

I just ran a test case with out exact code and it was correct.

All the tests pass also: https://github.com/milesj/php-decoda/blob/master/tests/filters/DefaultFilterTest.php#L76

remontees commented 12 years ago

It isn't. I am sure that It dosen't works with me. I have just text without title attribute. Check your code, or your test...

milesj commented 12 years ago

Are you using the latest version?

You can run the PHP Unit tests yourself and look.

remontees commented 12 years ago

Here's my configuration :

fm_bbcode:
    filter_sets:
        bbcode_reportages:
            locale: ru
            xhtml: true
            filters: [ default, block, image, list, quote, text, url ]

It works for bold, and many BBCodes but it fails for abbr. It can't parse any [abbr="Tada"]akjoe[/abbr]. But I use the last version of helios-ag/fm-bbcode-bundle.

milesj commented 12 years ago

You are using another 3rd parties code, I would report it to that project, not me.

remontees commented 12 years ago

But for filters' categories, is it good ?

milesj commented 12 years ago

Yes, assuming that project is using the correct Decoda version.

remontees commented 12 years ago

Where's the problem ?

I've remove xhtml true, and then, it parse the alternative text without and the link ! Same case for abbr ! But other BBcodes works.

But this is parsed : [url]http://remontees.free.fr[/url]

milesj commented 12 years ago

Take it up with helios-ag. All my test cases pass. Feel free to write your own test cases and prove me wrong.