Jelajahi Sumber

너무 길어서 수정 좀 함

ect (or 2du) 8 tahun lalu
induk
melakukan
9ad2887638
3 mengubah file dengan 9 tambahan dan 3 penghapusan
  1. 2 1
      set_mark/html_pas.py
  2. 5 1
      set_mark/mid_pas.py
  3. 2 1
      set_mark/table.py

+ 2 - 1
set_mark/html_pas.py

@@ -13,8 +13,9 @@ def html_pas(data):
                     src = re.search('src=([^ ]*)', i_list[2])
                     if(src):
                         v_src = re.search('http(?:s)?:\/\/([^/\'" ]*)', src.groups()[0])
+                        data_list = ["www.youtube.com", "serviceapi.nmv.naver.com", "tv.kakao.com", "www.google.com", "serviceapi.rmcnmv.naver.com"]
                         if(v_src):
-                            if(not v_src.groups()[0] in ["www.youtube.com", "serviceapi.nmv.naver.com", "tv.kakao.com", "www.google.com", "serviceapi.rmcnmv.naver.com"]):
+                            if(not v_src.groups()[0] in data_list):
                                 ot = re.sub('src=([^ ]*)', '', i_list[2])
                             else:
                                 ot = i_list[2]

+ 5 - 1
set_mark/mid_pas.py

@@ -96,7 +96,11 @@ def mid_pas(data, fol_num, include, in_c):
                 data = com.sub(html_d.groups()[0], data, 1)
             elif(fol):
                 fol_d = fol.groups()
-                data = com.sub( "<div>" + fol_d[0] + " <div id='folding_" + str(fol_num + 1) + "' style='display: inline-block;'>[<a href='javascript:void(0);' onclick='folding(" + str(fol_num + 1) + "); folding(" + str(fol_num + 2) + "); folding(" + str(fol_num) + ");'>펼치기</a>]</div><div id='folding_" + str(fol_num + 2) + "' style='display: none;'>[<a href='javascript:void(0);' onclick='folding(" + str(fol_num + 1) + "); folding(" + str(fol_num + 2) + "); folding(" + str(fol_num) + ");'>접기</a>]</div><div id='folding_" + str(fol_num) + "' style='display: none;'><br>" + fol_d[1] + "</div></div>", data, 1)
+                data = com.sub("<div>" + fol_d[0] + " <div id='folding_" + str(fol_num + 1) + "' style='display: inline-block;'>[<a href='javascript:void(0);' onclick='folding(" + str(fol_num + 1) + \
+                                "); folding(" + str(fol_num + 2) + "); folding(" + str(fol_num) + ");'>펼치기</a>]</div><div id='folding_" + str(fol_num + 2) + \
+                                "' style='display: none;'>[<a href='javascript:void(0);' onclick='folding(" + str(fol_num + 1) + "); folding(" + str(fol_num + 2) + \
+                                "); folding(" + str(fol_num) + ");'>접기</a>]</div><div id='folding_" + str(fol_num) + "' style='display: none;'><br>" + fol_d[1] + \
+                                "</div></div>", data, 1)
 
                 fol_num += 3
             elif(syn):

+ 2 - 1
set_mark/table.py

@@ -157,7 +157,8 @@ def table(data):
                         table_class = table_d[5]
                         num = table_d[6]
                             
-                        table = re.sub("^(\|\|(?:(?:\|\|)*))((?:&lt;(?:(?:(?!&gt;).)*)&gt;)*)", "<table " + table_class + " " + alltable + "><tbody><tr " + rowstyle + "><td " + cel + " " + row + " " + celstyle + ">", table, 1)
+                        table = re.sub("^(\|\|(?:(?:\|\|)*))((?:&lt;(?:(?:(?!&gt;).)*)&gt;)*)", \
+                                        "<table " + table_class + " " + alltable + "><tbody><tr " + rowstyle + "><td " + cel + " " + row + " " + celstyle + ">", table, 1)
                     else:
                         cel = 'colspan="' + str(round(len(result[0]) / 2)) + '"'