Răsfoiți Sursa

나무마크 버그 수정

Surplus_Up (2DU) 5 ani în urmă
părinte
comite
fa61af9e44

+ 20 - 19
route/api_w.py

@@ -7,39 +7,40 @@ def api_w_2(conn, name):
         curs.execute(db_change("select title from data where title = ?"), [name])
         if curs.fetchall():
             return flask.jsonify({ "exist" : "1" })
-        else:
-            return flask.jsonify({})
     else:
         if acl_check(name, 'render') != 1:
             if flask.request.method == 'POST':
-                g_data = render_set(title = name, data = flask.request.form.get('data', ''), num = 2)
+                g_data = flask.request.form.get('data', '')
+                g_data = render_set(title = name, data = g_data, num = 2)
 
                 return flask.jsonify({ "title" : name, "data" : g_data[0], "js_data" : g_data[1] })
             else:
                 curs.execute(db_change("select data from data where title = ?"), [name])
                 data = curs.fetchall()
                 if data:
-                    if flask.request.args.get('include', 'include_1'):
-                        json_data = data[0][0]
-
-                        get_all_change_1 = [('@' + i[0] + '@', i[1]) for i in re.findall(r'@([^=]+)=([^@]+)@', json_data)]
-                        json_data = re.sub(r'@(?P<in>[^=]+)=([^@]+)@', '@\g<in>@', json_data)
+                    json_data = data[0][0]
+                    include_data = flask.request.args.get('include', None)
+                    if include_data:
+                        get_all_change_1 = []
+                        find_replace_moment = re.findall(r'(@([^=@]+)=([^=@]+)@|@([^=@]+)@)', json_data)
+                        for i in find_replace_moment:
+                            if i[1] != '':
+                                get_all_change_1 += [['@' + i[1] + '@', i[2]]]
+
+                                json_data = json_data.replace(i[0], '@' + i[1] + '@', 1)
+                            else:
+                                json_data = json_data.replace(i[0], '@' + i[3] + '@', 1)
 
                         get_all_change_2 = re.findall(r'(@(?:[^@]*)@),([^,]*),', flask.request.args.get('change', '')) + get_all_change_1
                         for i in get_all_change_2:
                             json_data = json_data.replace(
                                 i[0].replace('<amp>', '&'), 
-                                i[1].replace('<amp>', '&').replace('<comma>', ',')
+                                i[1].replace('<amp>', '&').replace('<comma>', ','), 
+                                1
                             )
-
-                        g_data = render_set(title = name, data = json_data, num = 2, include = flask.request.args.get('include', 'include_1'))
-                    else:
-                        json_data = g_data[0]
-
-                        g_data = render_set(title = name, data = json_data, num = 2)
+                        
+                    g_data = render_set(title = name, data = json_data, num = 2, include = include_data)
 
                     return flask.jsonify({ "title" : name, "data" : g_data[0], "js_data" : g_data[1] })
-                else:
-                    return flask.jsonify({})
-        else:
-            return flask.jsonify({})
+
+    return flask.jsonify({})

+ 3 - 1
route/tool/func.py

@@ -65,6 +65,8 @@ for i in range(0, 2):
 
 global_lang = {}
 req_list = ''
+conn = ''
+curs = ''
 
 def load_conn(data):
     global conn
@@ -557,7 +559,7 @@ def next_fix(link, num, page, end = 50):
 
 def other2(data):
     global req_list
-    main_css_ver = '55'
+    main_css_ver = '56'
     data += ['' for _ in range(0, 3 - len(data))]
 
     if req_list == '':

+ 3 - 0
route/tool/mark.py

@@ -11,6 +11,9 @@ import asyncio
 import threading
 import urllib.parse
 
+conn = ''
+curs = ''
+
 if os.path.exists('route/tool/set_mark/custom.py'):
     from .set_mark.custom import custom_mark
 else:

+ 5 - 0
route/tool/set_mark/namumark.py

@@ -4,6 +4,11 @@ import datetime
 import html
 import re
 
+end_data = ''
+plus_data = ''
+nowiki_num = ''
+include_name = ''
+
 def nowiki_js(data):
     data = data.replace('\\', '\\\\')
     data = data.replace('"', '\\"')

+ 1 - 1
version.json

@@ -1,6 +1,6 @@
 {
     "beta" : {
-        "r_ver" : "v3.2.0-stable-13 (beta-39) (dev-2020-010-04-01)",
+        "r_ver" : "v3.2.0-stable-13 (beta-39) (dev-2020-10-04-01)",
         "c_ver" : "3203400",
         "s_ver" : "10"
     }

+ 1 - 1
views/main_css/js/load_namumark.js

@@ -73,7 +73,7 @@ function get_file_state(data, i = 0) {
                         document.getElementsByClassName(data + 'file_finder')[i].innerHTML = '' +
                             '<a href="' + get_class.getAttribute('under_href') + '" ' + 
                                 'id="not_thing">' +
-                                + '(' + get_class.getAttribute('under_alt') + ')' +
+                                '(' + get_class.getAttribute('under_alt') + ')' +
                             '</a>' +
                         '';
                     } else {