Skip to content

Commit

Permalink
fix: use match_tokens() to check for a single code_inline
Browse files Browse the repository at this point in the history
  • Loading branch information
vberlier committed Feb 25, 2021
1 parent 1c27db5 commit 7117521
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lectern/extract.py
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ def parse_fragments(
)
and (inline := tokens[i + 1])
and inline.children
and inline.children[0].type == "code_inline"
and self.match_tokens(inline.children, "code_inline")
and (match := regex.match(inline.children[0].content))
):
yield self.create_fragment(match, content=tokens[i + 3].content)
Expand Down Expand Up @@ -231,7 +231,7 @@ def parse_fragments(
)
and (inline := tokens[i + 1])
and inline.children
and inline.children[0].type == "code_inline"
and self.match_tokens(inline.children, "code_inline")
and tokens[i + 3].content == "<details>\n"
and tokens[i + 5].content == "</details>\n"
and (match := regex.match(inline.children[0].content))
Expand Down Expand Up @@ -302,7 +302,7 @@ def parse_fragments(
)
and (inline := tokens[i + 1])
and inline.children
and inline.children[0].type == "code_inline"
and self.match_tokens(inline.children, "code_inline")
and (match := regex.match(inline.children[0].content))
):
yield self.create_fragment(match)
Expand Down

0 comments on commit 7117521

Please sign in to comment.