Răsfoiți Sursa

문단 버그 수정

Surplus_Up (2DU) 6 ani în urmă
părinte
comite
07ae64bdab
2 a modificat fișierele cu 5 adăugiri și 5 ștergeri
  1. 4 4
      route/edit.py
  2. 1 1
      version.json

+ 4 - 4
route/edit.py

@@ -66,18 +66,18 @@ def edit_2(conn, name):
         new = curs.fetchall()
         if new:
             if flask.request.args.get('section', None):
-                data = '\n' + re.sub('\r\n', '\n', new[0][0]) + '\n'
+                data = re.sub('\n(?P<in>={1,6})', '<br>\g<in>', '\n' + re.sub('\r\n', '\n', new[0][0]) + '\n')
                 i = 0
 
                 while 1:
-                    g_data = re.search('\n((?:={1,6}) ?(?:(?:(?!\n).)+) ?\n(?:(?:(?:(?!(?:={1,6}) ?(?:(?:(?!\n).)+) ?\n).)+\n+)+))', data)
+                    g_data = re.search('((?:<br>={1,6})(?:(?:(?!\n).)+)\n(?:(?:(?:(?!<br>(?:={1,6})).)+\n*)+))', data)
                     if g_data:
                         if int(flask.request.args.get('section', '1')) - 1 == i:
-                            data = g_data.groups()[0]
+                            data = re.sub('<br>(?P<in>={1,6})', '\n\g<in>', g_data.groups()[0])
                             
                             break
                         else:
-                            data = re.sub('\n((?:={1,6}) ?(?:(?:(?!\n).)+) ?\n(?:(?:(?:(?!(?:={1,6}) ?(?:(?:(?!\n).)+) ?\n).)+\n+)+))', '\n', data, 1)
+                            data = re.sub('((?:<br>={1,6})(?:(?:(?!\n).)+)\n(?:(?:(?:(?!<br>(?:={1,6})).)+\n*)+))', '\n', data, 1)
 
                         i += 1
                     else:

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "master" : {
-        "r_ver" : "v3.1.2-master-08",
+        "r_ver" : "v3.1.2-master-09",
         "c_ver" : "400001",
         "s_ver" : "2"
     }, "stable" : {