|
@@ -74,6 +74,7 @@ def send_p(d):
|
|
|
return(d)
|
|
return(d)
|
|
|
|
|
|
|
|
def table_p(d, d2):
|
|
def table_p(d, d2):
|
|
|
|
|
+ table_class = 'class="'
|
|
|
alltable = 'style="'
|
|
alltable = 'style="'
|
|
|
celstyle = 'style="'
|
|
celstyle = 'style="'
|
|
|
rowstyle = 'style="'
|
|
rowstyle = 'style="'
|
|
@@ -119,41 +120,34 @@ def table_p(d, d2):
|
|
|
if(table_row):
|
|
if(table_row):
|
|
|
row = 'rowspan="' + table_row.groups()[0] + '"'
|
|
row = 'rowspan="' + table_row.groups()[0] + '"'
|
|
|
|
|
|
|
|
- row_bgcolor_2 = re.search("<rowbgcolor=(#(?:[0-9a-f-A-F]{6}|[0-9a-f-A-F]{3}))>", d)
|
|
|
|
|
|
|
+ row_bgcolor_2 = re.search("<rowbgcolor=(#(?:[0-9a-f-A-F]{3}){1,2})>", d)
|
|
|
row_bgcolor_3 = re.search("<rowbgcolor=(\w+)>", d)
|
|
row_bgcolor_3 = re.search("<rowbgcolor=(\w+)>", d)
|
|
|
if(row_bgcolor_2):
|
|
if(row_bgcolor_2):
|
|
|
rowstyle += 'background: ' + row_bgcolor_2.groups()[0] + ';'
|
|
rowstyle += 'background: ' + row_bgcolor_2.groups()[0] + ';'
|
|
|
elif(row_bgcolor_3):
|
|
elif(row_bgcolor_3):
|
|
|
rowstyle += 'background: ' + row_bgcolor_3.groups()[0] + ';'
|
|
rowstyle += 'background: ' + row_bgcolor_3.groups()[0] + ';'
|
|
|
|
|
|
|
|
- table_border_2 = re.search("<table\s?bordercolor=(#(?:[0-9a-f-A-F]{6}|[0-9a-f-A-F]{3}))>", d)
|
|
|
|
|
|
|
+ table_border_2 = re.search("<table\s?bordercolor=(#(?:[0-9a-f-A-F]{3}){1,2})>", d)
|
|
|
table_border_3 = re.search("<table\s?bordercolor=(\w+)>", d)
|
|
table_border_3 = re.search("<table\s?bordercolor=(\w+)>", d)
|
|
|
if(table_border_2):
|
|
if(table_border_2):
|
|
|
alltable += 'border: ' + table_border_2.groups()[0] + ' 2px solid;'
|
|
alltable += 'border: ' + table_border_2.groups()[0] + ' 2px solid;'
|
|
|
elif(table_border_3):
|
|
elif(table_border_3):
|
|
|
alltable += 'border: ' + table_border_3.groups()[0] + ' 2px solid;'
|
|
alltable += 'border: ' + table_border_3.groups()[0] + ' 2px solid;'
|
|
|
|
|
|
|
|
- table_bgcolor_2 = re.search("<table\s?bgcolor=(#(?:[0-9a-f-A-F]{6}|[0-9a-f-A-F]{3}))>", d)
|
|
|
|
|
|
|
+ table_bgcolor_2 = re.search("<table\s?bgcolor=(#(?:[0-9a-f-A-F]{3}){1,2})>", d)
|
|
|
table_bgcolor_3 = re.search("<table\s?bgcolor=(\w+)>", d)
|
|
table_bgcolor_3 = re.search("<table\s?bgcolor=(\w+)>", d)
|
|
|
if(table_bgcolor_2):
|
|
if(table_bgcolor_2):
|
|
|
alltable += 'background: ' + table_bgcolor_2.groups()[0] + ';'
|
|
alltable += 'background: ' + table_bgcolor_2.groups()[0] + ';'
|
|
|
elif(table_bgcolor_3):
|
|
elif(table_bgcolor_3):
|
|
|
alltable += 'background: ' + table_bgcolor_3.groups()[0] + ';'
|
|
alltable += 'background: ' + table_bgcolor_3.groups()[0] + ';'
|
|
|
|
|
|
|
|
- bgcolor_2 = re.search("<bgcolor=(#(?:[0-9a-f-A-F]{6}|[0-9a-f-A-F]{3}))>", d)
|
|
|
|
|
- bgcolor_3 = re.search("<bgcolor=(\w+)>", d)
|
|
|
|
|
|
|
+ bgcolor_2 = re.search("<(?:bgcolor=)?(#(?:[0-9a-f-A-F]{3}){1,2})>", d)
|
|
|
|
|
+ bgcolor_3 = re.search("<(?:bgcolor=)?(\w+)>", d)
|
|
|
if(bgcolor_2):
|
|
if(bgcolor_2):
|
|
|
celstyle += 'background: ' + bgcolor_2.groups()[0] + ';'
|
|
celstyle += 'background: ' + bgcolor_2.groups()[0] + ';'
|
|
|
elif(bgcolor_3):
|
|
elif(bgcolor_3):
|
|
|
celstyle += 'background: ' + bgcolor_3.groups()[0] + ';'
|
|
celstyle += 'background: ' + bgcolor_3.groups()[0] + ';'
|
|
|
|
|
|
|
|
- st_bgcolor_2 = re.search("<(#(?:[0-9a-f-A-F]{6}|[0-9a-f-A-F]{3}))>", d)
|
|
|
|
|
- st_bgcolor_3 = re.search("<(\w+)>", d)
|
|
|
|
|
- if(st_bgcolor_2):
|
|
|
|
|
- celstyle += 'background: ' + st_bgcolor_2.groups()[0] + ';'
|
|
|
|
|
- elif(st_bgcolor_3):
|
|
|
|
|
- celstyle += 'background: ' + st_bgcolor_3.groups()[0] + ';'
|
|
|
|
|
-
|
|
|
|
|
n_width = re.search("<width=((?:(?!>).)*)>", d)
|
|
n_width = re.search("<width=((?:(?!>).)*)>", d)
|
|
|
n_height = re.search("<height=((?:(?!>).)*)>", d)
|
|
n_height = re.search("<height=((?:(?!>).)*)>", d)
|
|
|
if(n_width):
|
|
if(n_width):
|
|
@@ -170,12 +164,18 @@ def table_p(d, d2):
|
|
|
celstyle += 'text-align: center;'
|
|
celstyle += 'text-align: center;'
|
|
|
elif(text_left):
|
|
elif(text_left):
|
|
|
celstyle += 'text-align: left;'
|
|
celstyle += 'text-align: left;'
|
|
|
|
|
+
|
|
|
|
|
+ text_class = re.search("<table\s?class=((?:(?!>).)+)>", d)
|
|
|
|
|
+ if(text_class):
|
|
|
|
|
+ d = text_class.groups()
|
|
|
|
|
+ table_class += d[0]
|
|
|
|
|
|
|
|
alltable += '"'
|
|
alltable += '"'
|
|
|
celstyle += '"'
|
|
celstyle += '"'
|
|
|
rowstyle += '"'
|
|
rowstyle += '"'
|
|
|
|
|
+ table_class += '"'
|
|
|
|
|
|
|
|
- return([alltable, rowstyle, celstyle, row, cel])
|
|
|
|
|
|
|
+ return([alltable, rowstyle, celstyle, row, cel, table_class])
|
|
|
|
|
|
|
|
def html_pas(data):
|
|
def html_pas(data):
|
|
|
data = re.sub('%H%', '<', data)
|
|
data = re.sub('%H%', '<', data)
|
|
@@ -910,8 +910,9 @@ def namumark(title, data, num, in_c, toc_y):
|
|
|
celstyle = table_d[2]
|
|
celstyle = table_d[2]
|
|
|
row = table_d[3]
|
|
row = table_d[3]
|
|
|
cel = table_d[4]
|
|
cel = table_d[4]
|
|
|
|
|
+ table_class = table_d[5]
|
|
|
|
|
|
|
|
- table = re.sub("^(\|\|(?:(?:\|\|)+)?)((?:<(?:(?:(?!>).)*)>)+)?", "<table " + alltable + "> \
|
|
|
|
|
|
|
+ table = re.sub("^(\|\|(?:(?:\|\|)+)?)((?:<(?:(?:(?!>).)*)>)+)?", "<table " + table_class + " " + alltable + "> \
|
|
|
<tbody> \
|
|
<tbody> \
|
|
|
<tr " + rowstyle + "> \
|
|
<tr " + rowstyle + "> \
|
|
|
<td " + cel + " " + row + " " + celstyle + ">", table, 1)
|
|
<td " + cel + " " + row + " " + celstyle + ">", table, 1)
|