diff --git a/reporting/md-toc b/reporting/md-toc index 2b385ea..92f225a 100755 --- a/reporting/md-toc +++ b/reporting/md-toc @@ -49,7 +49,16 @@ def main(): marker_found = False marker_end_found = False to_remove = [] + in_code = False + for i, row in enumerate(markdown): + in_table = row.startswith("|") + if row.startswith("```"): + in_code = not in_code + + if any((in_code, in_table)): + continue + if row.startswith("#"): headers, title = row.strip().split(" ", 1) if opts.l: