Skip to content

Dev #86

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
May 20, 2025
Merged

Dev #86

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down
7 changes: 4 additions & 3 deletions jinjafx_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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'<span class="\1">\2</span>', output, flags=re.DOTALL | re.IGNORECASE)
output = re.sub(r'{(highlight)}(.+?){/\1}', r'<span class="\1">\2</span>', output, flags=re.DOTALL | re.IGNORECASE)

for style in ['red', 'green', 'blue', 'highlight']:
output = re.sub('{(' + style + ')}(.+?){/\\1}', r'<span class="\1">\2</span>', output, flags=re.DOTALL | re.IGNORECASE)

head = '<!DOCTYPE html>\n<html>\n<head>\n'
head += '<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/github-markdown-css/5.8.1/github-markdown.min.css" crossorigin="anonymous">\n'
Expand Down
Loading