Kaynağa Gözat

1차 수정

ect (or 2du) 8 yıl önce
ebeveyn
işleme
b706f294f9
2 değiştirilmiş dosya ile 10 ekleme ve 16 silme
  1. 5 16
      mark.py
  2. 5 0
      set_mark/start.py

+ 5 - 16
mark.py

@@ -1,17 +1,4 @@
 from set_mark.start import start
-from set_mark.mid_pas import mid_pas
-from set_mark.html_pas import html_pas
-from set_mark.include_pas import include_pas
-from set_mark.macro import macro
-from set_mark.redirect_pas import redirect_pas
-from set_mark.blockquote import blockquote
-from set_mark.toc_pas import toc_pas
-from set_mark.text_help import text_help
-from set_mark.link import link
-from set_mark.indent import indent
-from set_mark.footnote import footnote
-from set_mark.table import table
-from set_mark.end import end
 
 import re
 import html
@@ -40,9 +27,11 @@ def plusing(conn, name, link, backtype):
     if not curs.fetchall():
         curs.execute("insert into back (title, link, type) values (?, ?, ?)", [link, name, backtype])
 
-def namumark(conn, title, data, num, in_c, toc_y):  
-#    data += '<script>function folding(num, test = 0) { var fol = document.getElementById(\'folding_\' + num); if(fol.style.display == \'inline-block\' || fol.style.display == \'block\') { fol.style.display = \'none\'; } else { if(num % 3 == 0 && test != 1) { fol.style.display = \'block\'; } else { fol.style.display = \'inline-block\'; } } } </script>'
-#    
+def namumark(conn, title, data, num, in_c, toc_y):
+    data = start(data)
+
+    data += '<script>function folding(num, test = 0) { var fol = document.getElementById(\'folding_\' + num); if(fol.style.display == \'inline-block\' || fol.style.display == \'block\') { fol.style.display = \'none\'; } else { if(num % 3 == 0 && test != 1) { fol.style.display = \'block\'; } else { fol.style.display = \'inline-block\'; } } } </script>'
+    
 #    if num == 1:        
 #        for d4 in backlink:
 #            t = threading.Thread(target = plusing, args = [conn, d4[0], d4[1], d4[2]])

+ 5 - 0
set_mark/start.py

@@ -0,0 +1,5 @@
+def start(data):
+    data = re.sub('\'\'(?P<in>(?:(?!\'\').)+)\'\'', '<b>\g<in></b>')
+    data = re.sub('\'\'\'(?P<in>(?:(?!\'\'\').)+)\'\'\'', '<b>\g<in></b>')
+
+    return data