shortcode icon indicating copy to clipboard operation
shortcode copied to clipboard

Empty strings as an attribute value are returned as an empty array

Open jwarchol opened this issue 3 years ago • 1 comments

When [quote name=""]Body text[/quote] is parsed, @attributes[:name] is an empty array. Is this expected behavior? I'd have expected it to be an empty string, or maybe nil.

jwarchol avatar Mar 29 '21 17:03 jwarchol

@jwarchol I'm not sure there is a test for this particular input with an empty attribute value. I'm not actively working on this project at the moment but would be happy to merge in a PR and release a new version if you wanted to change the behaviour.

I think the sensible thing to return in this situation would be an empty string as you suggest.

kernow avatar Mar 31 '21 09:03 kernow