소스 검색

파서 버그 수정 3

잉여개발기 (SPDV) 6 년 전
부모
커밋
dbf03ff1ae
3개의 변경된 파일18개의 추가작업 그리고 15개의 파일을 삭제
  1. 15 13
      route/tool/set_mark/namumark.py
  2. 1 1
      version.json
  3. 2 1
      views/main_css/css/main.css

+ 15 - 13
route/tool/set_mark/namumark.py

@@ -6,7 +6,8 @@ import re
 
 def table_parser(data, cel_data, start_data, num = 0):
     table_class = 'class="'
-    all_table = 'style="'
+    div_style = 'style="'
+    all_table = 'style="width: 100%;'
     cel_style = 'style="'
     row_style = 'style="'
     row = ''
@@ -15,9 +16,9 @@ def table_parser(data, cel_data, start_data, num = 0):
     table_width = re.search("<table ?width=((?:(?!>).)*)>", data)
     if table_width:
         if re.search('^[0-9]+$', table_width.groups()[0]):
-            all_table += 'width: ' + table_width.groups()[0] + 'px;'
+            div_style += 'width: ' + table_width.groups()[0] + 'px;'
         else:
-            all_table += 'width: ' + table_width.groups()[0] + ';'
+            div_style += 'width: ' + table_width.groups()[0] + ';'
     
     table_height = re.search("<table ?height=((?:(?!>).)*)>", data)
     if table_height:
@@ -136,12 +137,13 @@ def table_parser(data, cel_data, start_data, num = 0):
     if text_class:
         table_class += text_class.groups()[0]
         
+    div_style += '"'
     all_table += '"'
     cel_style += '"'
     row_style += '"'
     table_class += '"'
 
-    return [all_table, row_style, cel_style, row, cel, table_class, num]
+    return [all_table, row_style, cel_style, row, cel, table_class, num, div_style]
     
 def table_start(data):
     while 1:
@@ -152,25 +154,25 @@ def table_start(data):
                 all_table = re.search('^((?:\|\|)+)((?:<(?:(?:(?!>).)+)>)*)\n*((?:(?!\|\|).\n*)*)', table)
                 if all_table:
                     all_table = all_table.groups()
-                    
+
                     return_table = table_parser(all_table[1], all_table[2], all_table[0])
-                    
                     number = return_table[6]
                     
                     table = re.sub(
                         '^((?:\|\|)+)((?:<(?:(?:(?!>).)+)>)*)\n*', 
                         '\n' + \
-                            '<table ' + return_table[5] + ' ' + return_table[0] + '>' + \
-                                '<tbody>' + \
-                                    '<tr ' + return_table[1] + '>' + \
-                                        '<td ' + return_table[2] + ' ' + return_table[3] + ' ' + return_table[4] + '>', 
+                            '<div class="table_safe" ' + return_table[7] + '>' + \
+                                '<table ' + return_table[5] + ' ' + return_table[0] + '>' + \
+                                    '<tbody>' + \
+                                        '<tr ' + return_table[1] + '>' + \
+                                            '<td ' + return_table[2] + ' ' + return_table[3] + ' ' + return_table[4] + '>', 
                         table, 
                         1
                     )
                 else:
                     break
                     
-            table = re.sub('\|\|\n?$', '</td></tr></tbody></table>', table)
+            table = re.sub('\|\|\n?$', '</td></tr></tbody></table></div>', table)
 
             while 1:
                 row_table = re.search('\|\|\n((?:\|\|)+)((?:&lt;(?:(?:(?!&gt;).)+)&gt;)*)\n*((?:(?!\|\||<\/td>).\n*)*)', table)
@@ -263,7 +265,7 @@ def middle_parser(data, fol_num, syntax_num, folding_num, include_num):
                             
                             data = middle_re.sub('<span style="font-size: ' + font_size + '%;">', data, 1)
                         elif re.search('^#!wiki', middle_data[0]):
-                            middle_data_2 = re.search('{{{#!wiki(?: style=(?:&quot;|&#x27;)((?:(?!&quot;|&#x27;).)*)(?:&quot;|&#x27;))?\n?', data)
+                            middle_data_2 = re.search('{{{#!wiki(?: style=(?:&quot;|&#x27;)((?:(?!&quot;|&#x27;).)*)(?:&quot;|&#x27;))?(?:[^\n]+)\n?', data)
                             if middle_data_2:
                                 middle_data_2 = middle_data_2.groups()
                             else:
@@ -272,7 +274,7 @@ def middle_parser(data, fol_num, syntax_num, folding_num, include_num):
                             middle_list += ['div_1']
                             
                             data = re.sub(
-                                '{{{#!wiki(?: style=(?:&quot;|&#x27;)((?:(?!&quot;|&#x27;).)*)(?:&quot;|&#x27;))?\n?',
+                                '{{{#!wiki(?: style=(?:&quot;|&#x27;)((?:(?!&quot;|&#x27;).)*)(?:&quot;|&#x27;))?(?:[^\n]+)\n?',
                                 '<div id="wiki_div" style="' + str(middle_data_2[0] if middle_data_2[0] else '') + '">', 
                                 data, 
                                 1

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "master" : {
-        "r_ver" : "v3.1.5-master-26",
+        "r_ver" : "v3.1.5-master-27",
         "c_ver" : "400006",
         "s_ver" : "6"
     }, "stable" : {

+ 2 - 1
views/main_css/css/main.css

@@ -43,4 +43,5 @@ blockquote { background-image: url(/views/acme/img/quote.png); background-positi
 @media (max-height: 400px) { .foot_plus { height: 80%; top: calc(100% - 92%); }}
 .foot_in { overflow-y: scroll; height: calc(100% - 20px); }
 #origin { display: none; }
-.all_in_data { display: block; width: 100%; }
+.all_in_data { display: block; width: 100%; }
+.table_safe { max-width: 100%; }