diff options
author | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-12 09:09:16 -0500 |
---|---|---|
committer | Blake DeMarcy <ofunknowndescent@gmail.com> | 2017-04-12 09:09:16 -0500 |
commit | 09077baeac68fdf4fa1178f7d410665387a74ca0 (patch) | |
tree | e8cd39673a844b197e8307eb47c175ff6c11ca95 /src | |
parent | 7eef803084d58b9a67736a5e67efd63ea825bd94 (diff) | |
download | bbj-09077baeac68fdf4fa1178f7d410665387a74ca0.tar.gz |
fake messages, formatting endpoint, new help menus
Diffstat (limited to 'src')
-rw-r--r-- | src/formatting.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/formatting.py b/src/formatting.py index acd7f63..67e3ecd 100644 --- a/src/formatting.py +++ b/src/formatting.py @@ -11,7 +11,7 @@ A B A N D O N ,: /.' ' This module includes a couple '/' of custom (GROAN) formatting + -specifications and parsers ' me irl +specifications and parsers ' for them. Why did i do this? `. I have no idea! .-"- ( | @@ -70,7 +70,7 @@ colors = [ ] markup = [ - "bold", "italic", "underline", "linequote", "quote", "rainbow" + "bold", "underline", "linequote", "quote", "rainbow" ] # PS: regex parsing is no longer used for these, preserving anyways @@ -82,6 +82,8 @@ markup = [ # quotes being references to other post_ids, like >>34 or >>0 for OP quotes = re.compile(">>([0-9]+)") +bold = re.compile(r"\*{2}(.{1,20})\*{2}") +underline = re.compile(r"__(.{1,20})__") def parse_segments(text, sanitize_linequotes=True): @@ -98,6 +100,8 @@ def parse_segments(text, sanitize_linequotes=True): if not segment: continue segment = quotes.sub(lambda m: "[quote: %s]" % m.group(1), segment) + segment = bold.sub(lambda m: "[bold: %s]" % m.group(1), segment) + segment = underline.sub(lambda m: "[underline: %s]" % m.group(1), segment) if segment.startswith(">"): if sanitize_linequotes: inner = segment.replace("]", "\\]") |