Enforce lack of whitespace between a tag and its arguments.

This makes constructs such as "@a (1, 2)" behave like "@a {1, 2}",
where @a tags the set (1, 2).
This commit is contained in:
Miguel Lechon
2021-02-21 18:58:33 +01:00
parent 5d5b4e730c
commit ee4989f6e3
+5 -1
View File
@@ -1733,7 +1733,11 @@ _MD_ParseTagList(MD_ParseCtx *ctx, MD_Node **first_out, MD_Node **last_out)
if(MD_Parse_RequireKind(ctx, MD_TokenKind_Identifier, &name))
{
MD_Node *tag = _MD_MakeNodeFromToken_Ctx(ctx, MD_NodeKind_Tag, name);
_MD_ParseSet(ctx, tag, _MD_ParseSetFlag_Paren, &tag->first_child, &tag->last_child);
MD_Token token = MD_Parse_PeekSkipSome(ctx, 0);
if(MD_StringMatch(token.string, MD_S8Lit("("), 0))
{
_MD_ParseSet(ctx, tag, _MD_ParseSetFlag_Paren, &tag->first_child, &tag->last_child);
}
_MD_PushNodeToList(&first, &last, MD_NilNode(), tag);
}
else