Jelajahi Sumber

문법 추가 및 파싱 변경

2DU 9 tahun lalu
induk
melakukan
e6d685c042
1 mengubah file dengan 13 tambahan dan 3 penghapusan
  1. 13 3
      app.py

+ 13 - 3
app.py

@@ -447,6 +447,16 @@ def namumark(title, data):
                                 alltable = alltable + 'margin:auto;'
                             else:
                                 alltable = alltable + 'margin-right:auto;'
+                                
+                        ee = re.search("<table\s?textalign=((?:(?!>).)*)>", result[1])
+                        if(ee):
+                            resultss = ee.groups()
+                            if(resultss[0] == 'right'):
+                                alltable = alltable + 'text-align:right;'
+                            elif(resultss[0] == 'center'):
+                                alltable = alltable + 'text-align:center;'
+                            else:
+                                alltable = alltable + 'text-align:left;'
                         
                         r = re.search("<-((?:(?!>).)*)>", result[1])
                         if(r):
@@ -540,7 +550,7 @@ def namumark(title, data):
                             celstyle = celstyle + 'text-align:right;'
                         elif(o):
                             celstyle = celstyle + 'text-align:center;'
-                        else:
+                        elif(p):
                             celstyle = celstyle + 'text-align:left;'
                             
                         alltable = alltable + '"'
@@ -634,7 +644,7 @@ def namumark(title, data):
                             celstyle = celstyle + 'text-align:right;'
                         elif(o):
                             celstyle = celstyle + 'text-align:center;'
-                        else:
+                        elif(p):
                             celstyle = celstyle + 'text-align:left;'
 
                         celstyle = celstyle + '"'
@@ -710,7 +720,7 @@ def namumark(title, data):
                             celstyle = celstyle + 'text-align:right;'
                         elif(o):
                             celstyle = celstyle + 'text-align:center;'
-                        else:
+                        elif(p):
                             celstyle = celstyle + 'text-align:left;'
 
                         celstyle = celstyle + '"'