Open jptissot opened 3 years ago
By default the identifier doesn't -
as a valid char.
But it should read quoted strings for argument names, i.e. [col 'offset-md'='5']
That being said, I wouldn't be against the identifier accepting -
as a valid char, we've already had the same problem reported in Orchard Core (fixed by validating the input for naming shortcodes), where they can't be named with a -
, only _
is valid.
But it should read quoted strings for argument names, i.e.
[col 'offset-md'='5']
Just tried this (with the OrchardCore ShortcodeTemplate feature) and the first arguments comes out as offset-lg
when quoted :(
@sebastienros is there any reason why -
is not a valid char for an identifier in parlot ?
Javascript/C# don't support it, and that would break a lot of grammars. For instance "a-b", I would expected to read it as "a - b". This is more like and html attribute name. Maybe that could be added in a specific category of parsers when common language identifiers are defined. Also I don't think no having it in the default identifier is a big issue since you can pass custom extra chars already in the Identifier() method.
Closing the issue in Parlot, but it should be fixed in the local grammar.
I was testing the shortcode feature in OrchardCore and passing an Argument with a
-
does not parse properly.For example,
[col offset-md='5']
the first argument isoffset-md='5'