jbowens / jBBCode

A lightweight but extensible BBCode parser
http://jbbcode.com
MIT License
164 stars 32 forks source link

Add support for multiple parameters #16

Closed shmax closed 10 years ago

shmax commented 10 years ago

Adds support for multiple parameters, such that any of the following are valid:

[img]www.example.com/example.png[/img]
[img="this is a caption"]www.example.com/example.png[/img]
[img="this is a caption"  height=200 width=500]www.example.com/example.png[/img]

All of the unit tests still pass, but the output of ElementNode::getAttribute() has changed slightly. Now, instead of returning a string, it returns a map of attribute names and values. The tag name itself is always one of the keys.