Explorar el Código

<math></math> 꼴도 지원

Surplus_Up (2DU) hace 7 años
padre
commit
d13cd56a3c
Se han modificado 3 ficheros con 2 adiciones y 3 borrados
  1. 0 1
      emergency_tool.py
  2. 1 2
      route/login.py
  3. 1 0
      route/tool/set_mark/namu.py

+ 0 - 1
emergency_tool.py

@@ -1,5 +1,4 @@
 import os
-import json
 import sqlite3
 import hashlib
 import threading

+ 1 - 2
route/login.py

@@ -14,8 +14,7 @@ def login_2(conn):
             return re_error('/error/13')
         else:
             captcha_post('', 0)
-
-        ip = ip_check()
+            
         agent = flask.request.headers.get('User-Agent')
 
         curs.execute("select pw, encode from user where id = ?", [flask.request.form.get('id', None)])

+ 1 - 0
route/tool/set_mark/namu.py

@@ -384,6 +384,7 @@ def namu(conn, data, title, main_num):
     backlink = []
     end_data = []
     
+    data = re.sub('<math>(?P<in>(?:(?!<\/math>).)+)<\/math>', '[math(\g<in>)]', data)
     data = html.escape(data)
 
     data = re.sub('\r\n', '\n', data)