", r"", r"", r"", r"", r"", r""
+ ]
+ fence_closers = [
+ r"```", r"~~~~",
+ r"
", r"", r"", r"", r"", r"", r""
+ ]
+ fence_opener_re = re.compile(rf"^({'|'.join(fence_openers)})\s*$", re.IGNORECASE)
+ fence_closer_re = re.compile(rf"^({'|'.join(fence_closers)})\s*$", re.IGNORECASE)
+
+ # Patterns for tags/titles, filenames, comments, and delimiters
+ tag_pattern = re.compile(
+ r"""(
+ ^\[[A-Z0-9 _:\-./()]+\]$ | # [ALL CAPS/NUMERIC/UNDERSCORE/ETC]
+ ^<[\w\s:\-./()|=\[\]!]+>$ | #