I believe the current implementation of getAllDefaultTags() is incorrect:
|
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' or yaml $(foo)
- load code block as YAML
- if parsed YAML contains
tag, add to list of default tags
Impacted PRs
I believe the current implementation of
getAllDefaultTags()is incorrect:avocado/src/index.ts
Lines 175 to 186 in 8ced072
lang=="yaml"tag, add to list of default tagsSteps 2 and 3 are bugs. Correct:
lang.trim().toLowerCase() === "yaml"yaml $(tag) == 'foo'oryaml $(foo)tag, add to list of default tagsImpacted PRs