skip tables and code
This commit is contained in:
@@ -41,7 +41,17 @@ def main():
|
|||||||
enumerator_match = [re.compile("^" + " " * (4 * x) + "[\d]+\. ") for x in range(4)]
|
enumerator_match = [re.compile("^" + " " * (4 * x) + "[\d]+\. ") for x in range(4)]
|
||||||
in_enumerator = False
|
in_enumerator = False
|
||||||
|
|
||||||
|
in_code = False
|
||||||
|
|
||||||
for i, row in enumerate(markdown):
|
for i, row in enumerate(markdown):
|
||||||
|
in_table = row.startswith("|")
|
||||||
|
if row.startswith("```"):
|
||||||
|
in_code = not in_code
|
||||||
|
|
||||||
|
if any((in_code, in_table)):
|
||||||
|
print(row)
|
||||||
|
continue
|
||||||
|
|
||||||
if opts.n:
|
if opts.n:
|
||||||
if row.startswith("#"):
|
if row.startswith("#"):
|
||||||
headers, title = row.strip().split(" ", 1)
|
headers, title = row.strip().split(" ", 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user