wip: Protect some HTML markers to base64 in article

This commit is contained in:
Cyrille L 2022-11-19 12:32:48 +01:00
parent 413b6d2912
commit 06794ea31a
1 changed files with 5 additions and 3 deletions

View File

@ -113,7 +113,8 @@ def manage_wip(file_post, Force):
# New line: | # # New line: | #
# Anchors: >> # # Anchors: >> #
# Paragraphs: ( = <p> # # Paragraphs: ( = <p> #
# bCodes: (( = <precode> # # bCodes: [[ = <precode> #
# Convert to HTML >> base64 #
#----------------------------# #----------------------------#
def wip_begin_markers(wip_lines): def wip_begin_markers(wip_lines):
global wip_html global wip_html
@ -121,7 +122,7 @@ def wip_begin_markers(wip_lines):
wip_tmp = '' wip_tmp = ''
# Set marker (regex to find), HTML, Need CSS # Set marker (regex to find), HTML, Need CSS
marks_html = [ marks_html = [
['^\|$|^\|\s' , '<br class="%s">' , True ], ['^\|$|^\|\s' , '<br class="%s">' , True ],
['^>>\s' , '<a id="%s"></a>' , True ], ['^>>\s' , '<a id="%s"></a>' , True ],
[r'^\($|\(\s' , '<p class="%s">' , True ], [r'^\($|\(\s' , '<p class="%s">' , True ],
['^\)$|^\)\s' , '</p>' , False], ['^\)$|^\)\s' , '</p>' , False],
@ -140,7 +141,8 @@ def wip_begin_markers(wip_lines):
line = line.replace(line, marker[1]%css_set) line = line.replace(line, marker[1]%css_set)
else: else:
line = line.replace(line, marker[1]) line = line.replace(line, marker[1])
convert_to_b64(line)
line = b64_content
wip_tmp = '%s%s\n'%(wip_tmp, line) wip_tmp = '%s%s\n'%(wip_tmp, line)
wip_html = wip_tmp wip_html = wip_tmp