Closed JayWood closed 9 years ago
I prefer that the close tag not be used if there is no selection. (i.e. use the self-closing shortcode)
This should be a parameter that is registered when _Shortcode_Button_
is first initiated, whether shortcode can wrap existing text. if not, should use default (existing) handling.
The log was just an oopsie on my part, but i'm sad that inline var declarations aren't a thing, they look so much cleaner.
I'll see what I can do about the registration parameter for closing tags. But that begs the question, if the user says 'yes' to closing tags, ie, the shortcode must use a selection, then wouldn't we require the user to make a selection before they can even use the shortcode?
Oh, and yes this currently works with the text only mode as well.
By 'user', I think you mean the dev who initiates, right? And no, i wasn't saying a selection should be required, though the parameter could take 'required' as a value if you want to make your PR work that way. the parameter would default to false (not allowed), could toggle to true (allowed) or 'required'.
Thanks dude!
Speaks for itself, this will wrap the user's selection in the short code tag, complete w/ closing tags.