Add support for long roll command

This commit is contained in:
Michal Kunc 2021-11-18 23:33:46 +01:00
parent 9641173758
commit 3982850dd3
Signed by: michal
GPG Key ID: 4CA5FB6559E0BDF8

View File

@ -21,7 +21,7 @@ def filter_vtt(text):
def compendium_return(m):
# TODO: Actually add links
return f"<a>{m.group(2)}</a>"
macro_re = re.compile(r"\[\[\/\S?r\s(?:(?P<sdice>[^\{\] ]+)[^\{\]]*|(?:\{(?P<ldice>[^\}]+)\}\[[^\]]+\])?)\]\](?:\{(?P<alt>[^\}]+)\})?")
macro_re = re.compile(r"\[\[\/\S+?r(?:oll)?\s(?:(?P<sdice>[^\{\] ]+)[^\{\]]*|(?:\{(?P<ldice>[^\}]+)\}\[[^\]]+\])?)\]\](?:\{(?P<alt>[^\}]+)\})?")
def macro_return(m):
if m.group('alt') is not None:
return m.group('alt')