-
Notifications
You must be signed in to change notification settings - Fork 14
Open
Description
I believe the current implementation of getAllDefaultTags() is incorrect:
Lines 175 to 186 in 8ced072
| const node = walkToNode(walker, n => n.type === 'code_block') | |
| if (!node) { | |
| break | |
| } | |
| const heading = nodeHeading(node) | |
| if (!heading) { | |
| continue | |
| } | |
| if (getHeadingLiteral(heading) === 'Basic Information' && node.literal) { | |
| const latestDefinition = safeLoad(node.literal) | |
| if (latestDefinition && latestDefinition.tag) { | |
| tags.push(latestDefinition.tag) |
- find all code blocks
- filter to those under markdown heading "Basic Information"
- load code block as YAML, without checking if
lang=="yaml" - if parsed YAML contains
tag, add to list of default tags
Steps 2 and 3 are bugs. Correct:
- find all code blocks
- filter to those where
lang.trim().toLowerCase() === "yaml"- excludes code blocks with non-default conditions like
yaml $(tag) == 'foo'oryaml $(foo)
- excludes code blocks with non-default conditions like
- load code block as YAML
- if parsed YAML contains
tag, add to list of default tags
Impacted PRs
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
📋 Backlog