mirror of
https://github.com/Ed94/metadesk.git
synced 2026-08-04 06:38:45 +00:00
before_comment fix.
When two or more comments are followed by a node, use the closest comment as the before_comment. Prior to the fix, this combination left node unbefore_commented: // comment1 \n // comment2 \n node
This commit is contained in:
+5
-1
@@ -1461,7 +1461,11 @@ _MD_ParseOneNode(MD_ParseCtx *ctx)
|
||||
else if(token.kind == MD_TokenKind_Newline)
|
||||
{
|
||||
MD_Parse_Bump(ctx, token);
|
||||
if(MD_Parse_RequireKind(ctx, MD_TokenKind_Newline, 0))
|
||||
if(MD_Parse_RequireKind(ctx, MD_TokenKind_Comment, &comment_token))
|
||||
{
|
||||
// NOTE(mal): If more than one comment, use the last comment
|
||||
}
|
||||
else if(MD_Parse_RequireKind(ctx, MD_TokenKind_Newline, 0))
|
||||
{
|
||||
_MD_MemoryZero(&comment_token, sizeof(comment_token));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user