diff --git a/CHANGELOG.md b/CHANGELOG.md index ade5d11..ead4af1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,7 +1,10 @@ ## CHANGELOG +### [25.7.5] - In Development +- Allow nested custom style tags in Markdown + ### [25.7.4] - May 19, 2025 -- Added support so you can use custom tags in markdown to change the colour or text (i.e. `{red}Red Text{/red}') +- Added support so you can use custom tags in Markdown to change the colour or text (i.e. `{red}Red Text{/red}') ### [25.7.3] - May 14, 2025 - DataTemplate is now considered "unsaved" if you change DataSets within a DataTemplate @@ -450,6 +453,7 @@ ### 21.11.0 - November 29, 2021 - Initial release +[25.7.5]: https://github.com/cmason3/jinjafx_server/compare/25.7.4...25.7.5 [25.7.4]: https://github.com/cmason3/jinjafx_server/compare/25.7.3...25.7.4 [25.7.3]: https://github.com/cmason3/jinjafx_server/compare/25.7.2...25.7.3 [25.7.2]: https://github.com/cmason3/jinjafx_server/compare/25.7.1...25.7.2 diff --git a/jinjafx_server.py b/jinjafx_server.py index 9841462..d214a1b 100755 --- a/jinjafx_server.py +++ b/jinjafx_server.py @@ -27,7 +27,7 @@ import re, argparse, hashlib, traceback, glob, hmac, uuid, struct, binascii, gzip, requests, ctypes, subprocess import cmarkgfm, emoji -__version__ = '25.7.4' +__version__ = '25.7.5' llock = threading.RLock() rlock = threading.RLock() @@ -593,8 +593,9 @@ def html_escape(text): o = oname + ':html' options = (cmarkgfm.cmark.Options.CMARK_OPT_GITHUB_PRE_LANG | cmarkgfm.cmark.Options.CMARK_OPT_SMART | cmarkgfm.cmark.Options.CMARK_OPT_UNSAFE) output = cmarkgfm.github_flavored_markdown_to_html(html_escape(output), options).replace('&', '&').replace('&', '&') - output = re.sub(r'{(red|green|blue)}(.+?){/\1}', r'\2', output, flags=re.DOTALL | re.IGNORECASE) - output = re.sub(r'{(highlight)}(.+?){/\1}', r'\2', output, flags=re.DOTALL | re.IGNORECASE) + + for style in ['red', 'green', 'blue', 'highlight']: + output = re.sub('{(' + style + ')}(.+?){/\\1}', r'\2', output, flags=re.DOTALL | re.IGNORECASE) head = '\n\n\n' head += '\n'