|
@@ -136,7 +136,7 @@ def table(data):
|
|
|
results = m.groups()
|
|
results = m.groups()
|
|
|
table = results[0]
|
|
table = results[0]
|
|
|
while(1):
|
|
while(1):
|
|
|
- a = re.search("^(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)((?:(?!\|\|).)*)", table)
|
|
|
|
|
|
|
+ a = re.search("^(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)((?:(?!\|\||<\/td>).)*)", table)
|
|
|
if(a):
|
|
if(a):
|
|
|
row = ''
|
|
row = ''
|
|
|
cel = ''
|
|
cel = ''
|
|
@@ -160,14 +160,22 @@ def table(data):
|
|
|
table = re.sub("^(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)", "<table " + table_class + " " + alltable + "><tbody><tr " + rowstyle + "><td " + cel + " " + row + " " + celstyle + ">", table, 1)
|
|
table = re.sub("^(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)", "<table " + table_class + " " + alltable + "><tbody><tr " + rowstyle + "><td " + cel + " " + row + " " + celstyle + ">", table, 1)
|
|
|
else:
|
|
else:
|
|
|
cel = 'colspan="' + str(round(len(result[0]) / 2)) + '"'
|
|
cel = 'colspan="' + str(round(len(result[0]) / 2)) + '"'
|
|
|
- table = re.sub("^(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)", "<table><tbody><tr><td " + cel + ">", table, 1)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if(re.search('^ (.*) $', result[2])):
|
|
|
|
|
+ celstyle += 'text-align: center;'
|
|
|
|
|
+ elif(re.search('^ (.*)$', result[2])):
|
|
|
|
|
+ celstyle += 'text-align: right;'
|
|
|
|
|
+ elif(re.search('^(.*) $', result[2])):
|
|
|
|
|
+ celstyle += 'text-align: left;'
|
|
|
|
|
+
|
|
|
|
|
+ table = re.sub("^(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)", "<table><tbody><tr><td " + cel + " style='" + celstyle + "'>", table, 1)
|
|
|
else:
|
|
else:
|
|
|
break
|
|
break
|
|
|
|
|
|
|
|
table = re.sub("\|\|$", "</td></tr></tbody></table>", table)
|
|
table = re.sub("\|\|$", "</td></tr></tbody></table>", table)
|
|
|
|
|
|
|
|
while(1):
|
|
while(1):
|
|
|
- b = re.search("\|\|\r\n(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)((?:(?!\|\|).)*)", table)
|
|
|
|
|
|
|
+ b = re.search("\|\|\r\n(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)((?:(?!\|\||<\/td>).)*)", table)
|
|
|
if(b):
|
|
if(b):
|
|
|
row = ''
|
|
row = ''
|
|
|
cel = ''
|
|
cel = ''
|
|
@@ -186,12 +194,20 @@ def table(data):
|
|
|
table = re.sub("\|\|\r\n(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)", "</td></tr><tr " + rowstyle + "><td " + cel + " " + row + " " + celstyle + ">", table, 1)
|
|
table = re.sub("\|\|\r\n(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)", "</td></tr><tr " + rowstyle + "><td " + cel + " " + row + " " + celstyle + ">", table, 1)
|
|
|
else:
|
|
else:
|
|
|
cel = 'colspan="' + str(round(len(result[0]) / 2)) + '"'
|
|
cel = 'colspan="' + str(round(len(result[0]) / 2)) + '"'
|
|
|
- table = re.sub("\|\|\r\n(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)", "</td></tr><tr><td " + cel + ">", table, 1)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if(re.search('^ (.*) $', result[2])):
|
|
|
|
|
+ celstyle += 'text-align: center;'
|
|
|
|
|
+ elif(re.search('^ (.*)$', result[2])):
|
|
|
|
|
+ celstyle += 'text-align: right;'
|
|
|
|
|
+ elif(re.search('^(.*) $', result[2])):
|
|
|
|
|
+ celstyle += 'text-align: left;'
|
|
|
|
|
+
|
|
|
|
|
+ table = re.sub("\|\|\r\n(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)", "</td></tr><tr><td " + cel + " style='" + celstyle + "'>", table, 1)
|
|
|
else:
|
|
else:
|
|
|
break
|
|
break
|
|
|
|
|
|
|
|
while(1):
|
|
while(1):
|
|
|
- c = re.search("(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)((?:(?!\|\|).)*)", table)
|
|
|
|
|
|
|
+ c = re.search("(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)((?:(?!\|\||<\/td>).)*)", table)
|
|
|
if(c):
|
|
if(c):
|
|
|
row = ''
|
|
row = ''
|
|
|
cel = ''
|
|
cel = ''
|
|
@@ -208,7 +224,15 @@ def table(data):
|
|
|
table = re.sub("(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)", "</td><td " + cel + " " + row + " " + celstyle + ">", table, 1)
|
|
table = re.sub("(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)", "</td><td " + cel + " " + row + " " + celstyle + ">", table, 1)
|
|
|
else:
|
|
else:
|
|
|
cel = 'colspan="' + str(round(len(result[0]) / 2)) + '"'
|
|
cel = 'colspan="' + str(round(len(result[0]) / 2)) + '"'
|
|
|
- table = re.sub("(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)", "</td><td " + cel + ">", table, 1)
|
|
|
|
|
|
|
+
|
|
|
|
|
+ if(re.search('^ (.*) $', result[2])):
|
|
|
|
|
+ celstyle += 'text-align: center;'
|
|
|
|
|
+ elif(re.search('^ (.*)$', result[2])):
|
|
|
|
|
+ celstyle += 'text-align: right;'
|
|
|
|
|
+ elif(re.search('^(.*) $', result[2])):
|
|
|
|
|
+ celstyle += 'text-align: left;'
|
|
|
|
|
+
|
|
|
|
|
+ table = re.sub("(\|\|(?:(?:\|\|)*))((?:<(?:(?:(?!>).)*)>)*)", "</td><td " + cel + " style='" + celstyle + "'>", table, 1)
|
|
|
else:
|
|
else:
|
|
|
break
|
|
break
|
|
|
|
|
|