|
@@ -305,18 +305,25 @@ class class_do_render_namumark:
|
|
|
|
|
|
|
|
data_name = self.get_tool_data_storage(
|
|
data_name = self.get_tool_data_storage(
|
|
|
'<h' + heading_level_str + '>',
|
|
'<h' + heading_level_str + '>',
|
|
|
- ' <sub><a id="edit_load_' + str(heading_count) + '" href="/edit_section/' + str(heading_count) + '/' + url_pas(self.doc_name) + '">✎</a></sub></h' + heading_level_str + '>',
|
|
|
|
|
|
|
+ '' + \
|
|
|
|
|
+ ' <sub>' + \
|
|
|
|
|
+ '<a id="' + self.doc_include + 'edit_load_' + str(heading_count) + '" href="/edit_section/' + str(heading_count) + '/' + url_pas(self.doc_name) + '">✎</a> ' + \
|
|
|
|
|
+ '</sub>' + \
|
|
|
|
|
+ '</h' + heading_level_str + '>' + \
|
|
|
|
|
+ '',
|
|
|
heading_data_org
|
|
heading_data_org
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
heading_data_complete = '' + \
|
|
heading_data_complete = '' + \
|
|
|
'\n<front_br>' + \
|
|
'\n<front_br>' + \
|
|
|
|
|
+ ('</div>' if heading_count != 1 else '') + \
|
|
|
'<' + data_name + '>' + \
|
|
'<' + data_name + '>' + \
|
|
|
'<heading_stack>' + \
|
|
'<heading_stack>' + \
|
|
|
heading_stack_str + \
|
|
heading_stack_str + \
|
|
|
'</heading_stack>' + \
|
|
'</heading_stack>' + \
|
|
|
' ' + heading_data_text + \
|
|
' ' + heading_data_text + \
|
|
|
'</' + data_name + '>' + \
|
|
'</' + data_name + '>' + \
|
|
|
|
|
+ '<div id="' + self.doc_include + 'opennamu_heading_' + str(heading_count) + '" style="display: block;">' + \
|
|
|
'<back_br>\n' + \
|
|
'<back_br>\n' + \
|
|
|
''
|
|
''
|
|
|
|
|
|
|
@@ -388,6 +395,8 @@ class class_do_render_namumark:
|
|
|
match = match.groups()
|
|
match = match.groups()
|
|
|
|
|
|
|
|
name_data = match[0]
|
|
name_data = match[0]
|
|
|
|
|
+ name_data = name_data.lower()
|
|
|
|
|
+
|
|
|
macro_split_regex = r'(?:^|,) *([^,]+)'
|
|
macro_split_regex = r'(?:^|,) *([^,]+)'
|
|
|
macro_split_sub_regex = r'(^[^=]+) *= *([^=]+)'
|
|
macro_split_sub_regex = r'(^[^=]+) *= *([^=]+)'
|
|
|
if name_data in ('youtube', 'nicovideo', 'navertv', 'kakaotv', 'vimeo'):
|
|
if name_data in ('youtube', 'nicovideo', 'navertv', 'kakaotv', 'vimeo'):
|
|
@@ -403,6 +412,8 @@ class class_do_render_namumark:
|
|
|
data_sub = re.search(macro_split_sub_regex, for_a)
|
|
data_sub = re.search(macro_split_sub_regex, for_a)
|
|
|
if data_sub:
|
|
if data_sub:
|
|
|
data_sub = data_sub.groups()
|
|
data_sub = data_sub.groups()
|
|
|
|
|
+ data_sub = [data_sub[0].lower(), data_sub[1]]
|
|
|
|
|
+
|
|
|
if data_sub[0] == 'width':
|
|
if data_sub[0] == 'width':
|
|
|
video_width = self.get_tool_px_add_check(data_sub[1])
|
|
video_width = self.get_tool_px_add_check(data_sub[1])
|
|
|
elif data_sub[0] == 'height':
|
|
elif data_sub[0] == 'height':
|
|
@@ -462,6 +473,8 @@ class class_do_render_namumark:
|
|
|
data_sub = re.search(macro_split_sub_regex, for_a)
|
|
data_sub = re.search(macro_split_sub_regex, for_a)
|
|
|
if data_sub:
|
|
if data_sub:
|
|
|
data_sub = data_sub.groups()
|
|
data_sub = data_sub.groups()
|
|
|
|
|
+ data_sub = [data_sub[0].lower(), data_sub[1]]
|
|
|
|
|
+
|
|
|
if data_sub[0] == 'ruby':
|
|
if data_sub[0] == 'ruby':
|
|
|
sub_text = data_sub[1]
|
|
sub_text = data_sub[1]
|
|
|
elif data_sub[0] == 'color':
|
|
elif data_sub[0] == 'color':
|
|
@@ -540,7 +553,9 @@ class class_do_render_namumark:
|
|
|
# single macro function
|
|
# single macro function
|
|
|
def do_render_macro_single(match):
|
|
def do_render_macro_single(match):
|
|
|
match_org = match
|
|
match_org = match
|
|
|
|
|
+
|
|
|
match = match.group(1)
|
|
match = match.group(1)
|
|
|
|
|
+ match = match.lower()
|
|
|
|
|
|
|
|
if match in ('date', 'datetime'):
|
|
if match in ('date', 'datetime'):
|
|
|
data_name = self.get_tool_data_storage(get_time(), '', match_org.group(0))
|
|
data_name = self.get_tool_data_storage(get_time(), '', match_org.group(0))
|
|
@@ -598,7 +613,7 @@ class class_do_render_namumark:
|
|
|
|
|
|
|
|
return '<' + data_name + '></' + data_name + '>'
|
|
return '<' + data_name + '></' + data_name + '>'
|
|
|
|
|
|
|
|
- self.render_data = re.sub(r'\[math\(((?:(?!\[math\(|\)\]).|\n)+)\)\]', do_render_math_sub, self.render_data)
|
|
|
|
|
|
|
+ self.render_data = re.sub(r'\[math\(((?:(?!\[math\(|\)\]).|\n)+)\)\]', do_render_math_sub, self.render_data, re.I)
|
|
|
|
|
|
|
|
def do_render_link(self):
|
|
def do_render_link(self):
|
|
|
link_regex = r'\[\[((?:(?!\[\[|\]\]|\||<|>).|<slash_[0-9]+>)+)(?:\|((?:(?!\[\[|\]\]|\|).)+))?\]\]'
|
|
link_regex = r'\[\[((?:(?!\[\[|\]\]|\||<|>).|<slash_[0-9]+>)+)(?:\|((?:(?!\[\[|\]\]|\|).)+))?\]\]'
|
|
@@ -620,7 +635,7 @@ class class_do_render_namumark:
|
|
|
link_main_org = link_main
|
|
link_main_org = link_main
|
|
|
|
|
|
|
|
# file link
|
|
# file link
|
|
|
- if re.search(r'^(파일|file|외부|out):', link_main):
|
|
|
|
|
|
|
+ if re.search(r'^(파일|file|외부|out):', link_main, re.I):
|
|
|
file_width = ''
|
|
file_width = ''
|
|
|
file_height = ''
|
|
file_height = ''
|
|
|
file_align = ''
|
|
file_align = ''
|
|
@@ -655,8 +670,8 @@ class class_do_render_namumark:
|
|
|
link_main_org = ''
|
|
link_main_org = ''
|
|
|
link_sub = link_main
|
|
link_sub = link_main
|
|
|
|
|
|
|
|
- link_out_regex = r'^(외부|out):'
|
|
|
|
|
- link_in_regex = r'^(파일|file):'
|
|
|
|
|
|
|
+ link_out_regex = re.compile('^(외부|out):', re.I)
|
|
|
|
|
+ link_in_regex = re.compile('^(파일|file):', re.I)
|
|
|
if re.search(link_out_regex, link_main):
|
|
if re.search(link_out_regex, link_main):
|
|
|
link_main = re.sub(link_out_regex, '', link_main)
|
|
link_main = re.sub(link_out_regex, '', link_main)
|
|
|
|
|
|
|
@@ -720,8 +735,8 @@ class class_do_render_namumark:
|
|
|
|
|
|
|
|
self.render_data = re.sub(link_regex, '<' + data_name + '></' + data_name + '>', self.render_data, 1)
|
|
self.render_data = re.sub(link_regex, '<' + data_name + '></' + data_name + '>', self.render_data, 1)
|
|
|
# category
|
|
# category
|
|
|
- elif re.search(r'^(분류|category):', link_main):
|
|
|
|
|
- link_main = re.sub(r'^(분류|category):', '', link_main)
|
|
|
|
|
|
|
+ elif re.search(r'^(분류|category):', link_main, re.I):
|
|
|
|
|
+ link_main = re.sub(r'^(분류|category):', '', link_main, re.I)
|
|
|
|
|
|
|
|
if self.data_category == '':
|
|
if self.data_category == '':
|
|
|
self.data_category = '<div class="opennamu_category">' + self.get_tool_lang('category') + ' : '
|
|
self.data_category = '<div class="opennamu_category">' + self.get_tool_lang('category') + ' : '
|
|
@@ -732,8 +747,8 @@ class class_do_render_namumark:
|
|
|
link_main += link_data[1]
|
|
link_main += link_data[1]
|
|
|
|
|
|
|
|
category_blur = ''
|
|
category_blur = ''
|
|
|
- if re.search(r'#blur$', link_main):
|
|
|
|
|
- link_main = re.sub(r'#blur$', '', link_main)
|
|
|
|
|
|
|
+ if re.search(r'#blur$', link_main, re.I):
|
|
|
|
|
+ link_main = re.sub(r'#blur$', '', link_main, re.I)
|
|
|
|
|
|
|
|
category_blur = 'opennamu_category_blur'
|
|
category_blur = 'opennamu_category_blur'
|
|
|
|
|
|
|
@@ -758,11 +773,13 @@ class class_do_render_namumark:
|
|
|
|
|
|
|
|
self.render_data = re.sub(link_regex, '', self.render_data, 1)
|
|
self.render_data = re.sub(link_regex, '', self.render_data, 1)
|
|
|
# out link
|
|
# out link
|
|
|
- elif re.search(r'^(?:inter|인터):([^:]+):', link_main):
|
|
|
|
|
- link_inter_name = re.search(r'^(?:inter|인터):([^:]+):', link_main)
|
|
|
|
|
|
|
+ elif re.search(r'^(?:inter|인터):([^:]+):', link_main, re.I):
|
|
|
|
|
+ link_inter_regex = re.compile('^(?:inter|인터):([^:]+):', re.I)
|
|
|
|
|
+
|
|
|
|
|
+ link_inter_name = re.search(link_inter_regex, link_main)
|
|
|
link_inter_name = link_inter_name.group(1)
|
|
link_inter_name = link_inter_name.group(1)
|
|
|
|
|
|
|
|
- link_main = re.sub(r'^(?:inter|인터):([^:]+):', '', link_main)
|
|
|
|
|
|
|
+ link_main = re.sub(link_inter_regex, '', link_main)
|
|
|
|
|
|
|
|
# sharp
|
|
# sharp
|
|
|
link_data_sharp_regex = r'#([^#]+)$'
|
|
link_data_sharp_regex = r'#([^#]+)$'
|
|
@@ -792,16 +809,20 @@ class class_do_render_namumark:
|
|
|
else:
|
|
else:
|
|
|
link_sub = ''
|
|
link_sub = ''
|
|
|
link_sub_storage = link_main_org
|
|
link_sub_storage = link_main_org
|
|
|
|
|
+ link_sub_storage = re.sub(link_inter_regex, '', link_sub_storage)
|
|
|
|
|
|
|
|
|
|
+ link_inter_icon = link_inter_name + ':'
|
|
|
if db_data[0][1] != '':
|
|
if db_data[0][1] != '':
|
|
|
- link_sub_storage = db_data[0][1] + link_sub_storage
|
|
|
|
|
|
|
+ link_inter_icon = db_data[0][1]
|
|
|
|
|
+
|
|
|
|
|
+ link_sub_storage = link_inter_icon + link_sub_storage
|
|
|
|
|
|
|
|
data_name = self.get_tool_data_storage('<a class="opennamu_link_inter" href="' + link_main + link_data_sharp + '">' + link_sub_storage, '</a>', link_data_full)
|
|
data_name = self.get_tool_data_storage('<a class="opennamu_link_inter" href="' + link_main + link_data_sharp + '">' + link_sub_storage, '</a>', link_data_full)
|
|
|
|
|
|
|
|
self.render_data = re.sub(link_regex, lambda x : ('<' + data_name + '>' + link_sub + '</' + data_name + '>'), self.render_data, 1)
|
|
self.render_data = re.sub(link_regex, lambda x : ('<' + data_name + '>' + link_sub + '</' + data_name + '>'), self.render_data, 1)
|
|
|
else:
|
|
else:
|
|
|
self.render_data = re.sub(link_regex, '', self.render_data, 1)
|
|
self.render_data = re.sub(link_regex, '', self.render_data, 1)
|
|
|
- elif re.search(r'^https?:\/\/', link_main):
|
|
|
|
|
|
|
+ elif re.search(r'^https?:\/\/', link_main, re.I):
|
|
|
link_main = self.get_tool_data_restore(link_main, do_type = 'slash')
|
|
link_main = self.get_tool_data_restore(link_main, do_type = 'slash')
|
|
|
link_main = html.unescape(link_main)
|
|
link_main = html.unescape(link_main)
|
|
|
link_main = re.sub(r'"', '"', link_main)
|
|
link_main = re.sub(r'"', '"', link_main)
|
|
@@ -837,12 +858,12 @@ class class_do_render_namumark:
|
|
|
link_main = re.sub(r'(\/[^/]+)$', '', link_main)
|
|
link_main = re.sub(r'(\/[^/]+)$', '', link_main)
|
|
|
elif re.search(r'^\/', link_main):
|
|
elif re.search(r'^\/', link_main):
|
|
|
link_main = re.sub(r'^\/', lambda x : (self.doc_name + '/'), link_main)
|
|
link_main = re.sub(r'^\/', lambda x : (self.doc_name + '/'), link_main)
|
|
|
- elif re.search(r'^:(분류|category):', link_main):
|
|
|
|
|
- link_main = re.sub(r'^:(분류|category):', 'category:', link_main)
|
|
|
|
|
- elif re.search(r'^:(파일|file):', link_main):
|
|
|
|
|
- link_main = re.sub(r'^:(파일|file):', 'file:', link_main)
|
|
|
|
|
- elif re.search(r'^사용자:', link_main):
|
|
|
|
|
- link_main = re.sub(r'^사용자:', 'user:', link_main)
|
|
|
|
|
|
|
+ elif re.search(r'^:(분류|category):', link_main, re.I):
|
|
|
|
|
+ link_main = re.sub(r'^:(분류|category):', 'category:', link_main, re.I)
|
|
|
|
|
+ elif re.search(r'^:(파일|file):', link_main, re.I):
|
|
|
|
|
+ link_main = re.sub(r'^:(파일|file):', 'file:', link_main, re.I)
|
|
|
|
|
+ elif re.search(r'^사용자:', link_main, re.I):
|
|
|
|
|
+ link_main = re.sub(r'^사용자:', 'user:', link_main, re.I)
|
|
|
|
|
|
|
|
# main link fix
|
|
# main link fix
|
|
|
link_main = self.get_tool_data_restore(link_main, do_type = 'slash')
|
|
link_main = self.get_tool_data_restore(link_main, do_type = 'slash')
|
|
@@ -942,7 +963,7 @@ class class_do_render_namumark:
|
|
|
return slash_add + match[2]
|
|
return slash_add + match[2]
|
|
|
|
|
|
|
|
include_num = 0
|
|
include_num = 0
|
|
|
- include_regex = r'\[include\(((?:(?!\[include\(|\)\]|<\/div>).)+)\)\]'
|
|
|
|
|
|
|
+ include_regex = re.compile('\[include\(((?:(?!\[include\(|\)\]|<\/div>).)+)\)\]', re.I)
|
|
|
include_count_max = len(re.findall(include_regex, self.render_data)) * 2
|
|
include_count_max = len(re.findall(include_regex, self.render_data)) * 2
|
|
|
include_change_list = {}
|
|
include_change_list = {}
|
|
|
while 1:
|
|
while 1:
|
|
@@ -1027,7 +1048,7 @@ class class_do_render_namumark:
|
|
|
|
|
|
|
|
def do_redner_footnote(self):
|
|
def do_redner_footnote(self):
|
|
|
footnote_num = 0
|
|
footnote_num = 0
|
|
|
- footnote_regex = r'(?:\[\*((?:(?!\[\*|\]| ).)+)?(?: ((?:(?!\[\*|\]).)+))?\]|\[(각주|footnote)\])'
|
|
|
|
|
|
|
+ footnote_regex = re.compile('(?:\[\*((?:(?!\[\*|\]| ).)+)?(?: ((?:(?!\[\*|\]).)+))?\]|\[(각주|footnote)\])', re.I)
|
|
|
footnote_count_all = len(re.findall(footnote_regex, self.render_data)) * 4
|
|
footnote_count_all = len(re.findall(footnote_regex, self.render_data)) * 4
|
|
|
while 1:
|
|
while 1:
|
|
|
footnote_num += 1
|
|
footnote_num += 1
|
|
@@ -1077,7 +1098,7 @@ class class_do_render_namumark:
|
|
|
self.render_data += self.get_tool_footnote_make()
|
|
self.render_data += self.get_tool_footnote_make()
|
|
|
|
|
|
|
|
def do_render_redirect(self):
|
|
def do_render_redirect(self):
|
|
|
- match = re.search(r'^<back_br>\n#(?:redirect|넘겨주기) ([^\n]+)', self.render_data)
|
|
|
|
|
|
|
+ match = re.search(r'^<back_br>\n#(?:redirect|넘겨주기) ([^\n]+)', self.render_data, re.I)
|
|
|
if match and self.doc_include == '':
|
|
if match and self.doc_include == '':
|
|
|
link_data_full = match.group(0)
|
|
link_data_full = match.group(0)
|
|
|
link_main = match.group(1)
|
|
link_main = match.group(1)
|
|
@@ -1131,7 +1152,7 @@ class class_do_render_namumark:
|
|
|
# get_tool_css_safe
|
|
# get_tool_css_safe
|
|
|
# todo : after text render text not use to make table
|
|
# todo : after text render text not use to make table
|
|
|
def do_render_table_parameter(cell_count, parameter, data, option = {}):
|
|
def do_render_table_parameter(cell_count, parameter, data, option = {}):
|
|
|
- table_parameter_all = { "div" : "", "table" : "", "tr" : "", "td" : "", "col" : "", "colspan" : "", "rowspan" : "", "data" : "" }
|
|
|
|
|
|
|
+ table_parameter_all = { "div" : "", "class" : "", "table" : "", "tr" : "", "td" : "", "col" : "", "colspan" : "", "rowspan" : "", "data" : "" }
|
|
|
|
|
|
|
|
table_align_auto = 1
|
|
table_align_auto = 1
|
|
|
table_colspan_auto = 1
|
|
table_colspan_auto = 1
|
|
@@ -1142,7 +1163,10 @@ class class_do_render_namumark:
|
|
|
table_parameter_split = table_parameter.split('=')
|
|
table_parameter_split = table_parameter.split('=')
|
|
|
if len(table_parameter_split) == 2:
|
|
if len(table_parameter_split) == 2:
|
|
|
table_parameter_name = table_parameter_split[0].replace(' ', '')
|
|
table_parameter_name = table_parameter_split[0].replace(' ', '')
|
|
|
|
|
+ table_parameter_name = table_parameter_name.lower()
|
|
|
|
|
+
|
|
|
table_parameter_data = self.get_tool_css_safe(table_parameter_split[1])
|
|
table_parameter_data = self.get_tool_css_safe(table_parameter_split[1])
|
|
|
|
|
+
|
|
|
if table_parameter_name == 'tablebgcolor':
|
|
if table_parameter_name == 'tablebgcolor':
|
|
|
table_parameter_all['table'] += 'background:' + self.get_tool_dark_mode_split(table_parameter_data) + ';'
|
|
table_parameter_all['table'] += 'background:' + self.get_tool_dark_mode_split(table_parameter_data) + ';'
|
|
|
elif table_parameter_name == 'tablewidth':
|
|
elif table_parameter_name == 'tablewidth':
|
|
@@ -1155,6 +1179,8 @@ class class_do_render_namumark:
|
|
|
elif table_parameter_data == 'center':
|
|
elif table_parameter_data == 'center':
|
|
|
table_parameter_all['div'] += 'margin:auto;'
|
|
table_parameter_all['div'] += 'margin:auto;'
|
|
|
table_parameter_all['table'] += 'margin:auto;'
|
|
table_parameter_all['table'] += 'margin:auto;'
|
|
|
|
|
+ elif table_parameter_name == 'tableclass':
|
|
|
|
|
+ table_parameter_all['class'] = table_parameter_split[1]
|
|
|
elif table_parameter_name == 'tabletextalign':
|
|
elif table_parameter_name == 'tabletextalign':
|
|
|
table_parameter_all['table'] += 'text-align:' + table_parameter_data + ';'
|
|
table_parameter_all['table'] += 'text-align:' + table_parameter_data + ';'
|
|
|
elif table_parameter_name == 'tablecolor':
|
|
elif table_parameter_name == 'tablecolor':
|
|
@@ -1247,7 +1273,7 @@ class class_do_render_namumark:
|
|
|
else:
|
|
else:
|
|
|
table_caption = ''
|
|
table_caption = ''
|
|
|
|
|
|
|
|
- table_parameter = { "div" : "", "table" : "", "col" : {}, "rowspan" : {} }
|
|
|
|
|
|
|
+ table_parameter = { "div" : "", "class" : "", "table" : "", "col" : {}, "rowspan" : {} }
|
|
|
table_data_end = ''
|
|
table_data_end = ''
|
|
|
table_col_num = 0
|
|
table_col_num = 0
|
|
|
table_tr_change = 0
|
|
table_tr_change = 0
|
|
@@ -1280,6 +1306,7 @@ class class_do_render_namumark:
|
|
|
table_parameter['col'][table_col_num] = ''
|
|
table_parameter['col'][table_col_num] = ''
|
|
|
|
|
|
|
|
table_parameter['div'] += table_sub_parameter['div']
|
|
table_parameter['div'] += table_sub_parameter['div']
|
|
|
|
|
+ table_parameter['class'] = table_sub_parameter['class'] if table_sub_parameter['class'] != '' else table_parameter['class']
|
|
|
table_parameter['table'] += table_sub_parameter['table']
|
|
table_parameter['table'] += table_sub_parameter['table']
|
|
|
table_parameter['col'][table_col_num] += table_sub_parameter['col']
|
|
table_parameter['col'][table_col_num] += table_sub_parameter['col']
|
|
|
|
|
|
|
@@ -1293,7 +1320,7 @@ class class_do_render_namumark:
|
|
|
table_col_num += 1
|
|
table_col_num += 1
|
|
|
|
|
|
|
|
table_data_end += '</tr>'
|
|
table_data_end += '</tr>'
|
|
|
- table_data_end = '<table style="' + table_parameter['table'] + '">' + table_caption + table_data_end + '</table>'
|
|
|
|
|
|
|
+ table_data_end = '<table class="' + table_parameter['class'] + '" style="' + table_parameter['table'] + '">' + table_caption + table_data_end + '</table>'
|
|
|
table_data_end = '<div class="table_safe" style="' + table_parameter['div'] + '">' + table_data_end + '</div>'
|
|
table_data_end = '<div class="table_safe" style="' + table_parameter['div'] + '">' + table_data_end + '</div>'
|
|
|
|
|
|
|
|
self.render_data = re.sub(table_regex, lambda x : ('\n<front_br>' + table_data_end + '<back_br>\n'), self.render_data, 1)
|
|
self.render_data = re.sub(table_regex, lambda x : ('\n<front_br>' + table_data_end + '<back_br>\n'), self.render_data, 1)
|
|
@@ -1329,13 +1356,14 @@ class class_do_render_namumark:
|
|
|
middle_data_pass = ''
|
|
middle_data_pass = ''
|
|
|
if middle_name:
|
|
if middle_name:
|
|
|
middle_name = middle_name.group(1)
|
|
middle_name = middle_name.group(1)
|
|
|
|
|
+ middle_name = middle_name.lower()
|
|
|
if middle_name == '#!wiki':
|
|
if middle_name == '#!wiki':
|
|
|
if middle_slash:
|
|
if middle_slash:
|
|
|
middle_data_org = re.sub(r'<(\/?(?:slash)_(?:[0-9]+))>', '<temp_' + middle_slash + '>', middle_data_org)
|
|
middle_data_org = re.sub(r'<(\/?(?:slash)_(?:[0-9]+))>', '<temp_' + middle_slash + '>', middle_data_org)
|
|
|
self.render_data = re.sub(middle_regex, lambda x : middle_data_org, self.render_data, 1)
|
|
self.render_data = re.sub(middle_regex, lambda x : middle_data_org, self.render_data, 1)
|
|
|
continue
|
|
continue
|
|
|
|
|
|
|
|
- wiki_regex = r'^#!wiki(?:(?: style=("(?:(?:(?!").)*)"|'(?:(?:(?!').)*)'))| [^\n]*)?\n'
|
|
|
|
|
|
|
+ wiki_regex = re.compile('^#!wiki(?:(?: style=("(?:(?:(?!").)*)"|'(?:(?:(?!').)*)'))| [^\n]*)?\n', re.I)
|
|
|
wiki_data_style = re.search(wiki_regex, middle_data)
|
|
wiki_data_style = re.search(wiki_regex, middle_data)
|
|
|
wiki_data = re.sub(wiki_regex, '', middle_data)
|
|
wiki_data = re.sub(wiki_regex, '', middle_data)
|
|
|
if wiki_data_style:
|
|
if wiki_data_style:
|
|
@@ -1370,7 +1398,7 @@ class class_do_render_namumark:
|
|
|
self.render_data = re.sub(middle_regex, lambda x : middle_data_org, self.render_data, 1)
|
|
self.render_data = re.sub(middle_regex, lambda x : middle_data_org, self.render_data, 1)
|
|
|
continue
|
|
continue
|
|
|
|
|
|
|
|
- wiki_regex = r'^#!folding(?: ([^\n]*))?\n'
|
|
|
|
|
|
|
+ wiki_regex = re.compile('^#!folding(?: ([^\n]*))?\n', re.I)
|
|
|
wiki_data_folding = re.search(wiki_regex, middle_data)
|
|
wiki_data_folding = re.search(wiki_regex, middle_data)
|
|
|
wiki_data = re.sub(wiki_regex, '', middle_data)
|
|
wiki_data = re.sub(wiki_regex, '', middle_data)
|
|
|
if wiki_data_folding:
|
|
if wiki_data_folding:
|
|
@@ -1399,7 +1427,7 @@ class class_do_render_namumark:
|
|
|
self.render_data = re.sub(middle_regex, lambda x : middle_data_org, self.render_data, 1)
|
|
self.render_data = re.sub(middle_regex, lambda x : middle_data_org, self.render_data, 1)
|
|
|
continue
|
|
continue
|
|
|
|
|
|
|
|
- wiki_regex = r'^#!syntax(?: ([^\n]*))?\n'
|
|
|
|
|
|
|
+ wiki_regex = re.compile('^#!syntax(?: ([^\n]*))?\n', re.I)
|
|
|
wiki_data_syntax = re.search(wiki_regex, middle_data)
|
|
wiki_data_syntax = re.search(wiki_regex, middle_data)
|
|
|
wiki_data = re.sub(wiki_regex, '', middle_data)
|
|
wiki_data = re.sub(wiki_regex, '', middle_data)
|
|
|
if wiki_data_syntax:
|
|
if wiki_data_syntax:
|
|
@@ -1550,7 +1578,7 @@ class class_do_render_namumark:
|
|
|
hr_count_max -= 1
|
|
hr_count_max -= 1
|
|
|
|
|
|
|
|
def do_render_list(self):
|
|
def do_render_list(self):
|
|
|
- quote_regex = r'((?:\n> *[^\n]+)+)\n'
|
|
|
|
|
|
|
+ quote_regex = r'((?:\n> *[^\n]*)+)\n'
|
|
|
quote_count = 0
|
|
quote_count = 0
|
|
|
quote_count_max = len(re.findall(quote_regex, self.render_data)) * 10
|
|
quote_count_max = len(re.findall(quote_regex, self.render_data)) * 10
|
|
|
while 1:
|
|
while 1:
|
|
@@ -1562,7 +1590,7 @@ class class_do_render_namumark:
|
|
|
else:
|
|
else:
|
|
|
quote_data_org = quote_data.group(0)
|
|
quote_data_org = quote_data.group(0)
|
|
|
quote_data = quote_data.group(1)
|
|
quote_data = quote_data.group(1)
|
|
|
- quote_data = re.sub(r'\n> *(?P<in>[^\n]+)', '\g<in>\n', quote_data)
|
|
|
|
|
|
|
+ quote_data = re.sub(r'\n> *(?P<in>[^\n]*)', '\g<in>\n', quote_data)
|
|
|
quote_data = html.unescape(quote_data)
|
|
quote_data = html.unescape(quote_data)
|
|
|
|
|
|
|
|
self.data_include += [[self.doc_include + 'opennamu_quote_' + str(quote_count), self.doc_name, quote_data, '']]
|
|
self.data_include += [[self.doc_include + 'opennamu_quote_' + str(quote_count), self.doc_name, quote_data, '']]
|
|
@@ -1591,7 +1619,7 @@ class class_do_render_namumark:
|
|
|
|
|
|
|
|
return '<li style="margin-left: ' + str(list_len * 20) + 'px;' + list_style_data + '">' + list_data + '</li>'
|
|
return '<li style="margin-left: ' + str(list_len * 20) + 'px;' + list_style_data + '">' + list_data + '</li>'
|
|
|
|
|
|
|
|
- list_regex = r'((?:\n *\* ?[^\n]+)+)\n'
|
|
|
|
|
|
|
+ list_regex = r'((?:\n *\* ?[^\n]*)+)\n'
|
|
|
list_count_max = len(re.findall(list_regex, self.render_data)) * 3
|
|
list_count_max = len(re.findall(list_regex, self.render_data)) * 3
|
|
|
while 1:
|
|
while 1:
|
|
|
list_data = re.search(list_regex, self.render_data)
|
|
list_data = re.search(list_regex, self.render_data)
|
|
@@ -1601,7 +1629,7 @@ class class_do_render_namumark:
|
|
|
break
|
|
break
|
|
|
else:
|
|
else:
|
|
|
list_data = list_data.group(1)
|
|
list_data = list_data.group(1)
|
|
|
- list_sub_regex = r'\n( *)\* ?([^\n]+)'
|
|
|
|
|
|
|
+ list_sub_regex = r'\n( *)\* ?([^\n]*)'
|
|
|
|
|
|
|
|
list_data = re.sub(list_sub_regex, do_render_list_sub, list_data)
|
|
list_data = re.sub(list_sub_regex, do_render_list_sub, list_data)
|
|
|
|
|
|
|
@@ -1651,6 +1679,7 @@ class class_do_render_namumark:
|
|
|
|
|
|
|
|
# add toc
|
|
# add toc
|
|
|
if self.data_toc != '':
|
|
if self.data_toc != '':
|
|
|
|
|
+ self.render_data += '</div>'
|
|
|
toc_search_regex = r'<toc_data>((?:(?!<toc_data>|<\/toc_data>).)*)<\/toc_data>'
|
|
toc_search_regex = r'<toc_data>((?:(?!<toc_data>|<\/toc_data>).)*)<\/toc_data>'
|
|
|
|
|
|
|
|
toc_data_on = 0
|
|
toc_data_on = 0
|