Skip to content

Commit fab7ba5

Browse files
committed
Do an actual full tree search for blocks.
1 parent 3471036 commit fab7ba5

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

aws_doc_sdk_examples_tools/metadata_validator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def _validate_aws_entity_usage(value: str) -> bool:
167167
"""
168168
xval = value.replace('&', '&')
169169
xtree = xml_tree.fromstring(f"<fake><para>{xval}</para></fake>")
170-
blocks = xtree.findall("programlisting") + xtree.findall("code") + xtree.findall("noloc")
170+
blocks = xtree.findall(".//programlisting") + xtree.findall(".//code") + xtree.findall(".//noloc")
171171
aws_in_blocks = 0
172172
for element in blocks:
173173
aws_in_blocks += len(re.findall("(?<![&0-9a-zA-Z])AWS(?![;0-9a-zA-Z])", element.text))

0 commit comments

Comments
 (0)