Explorar o código

버그 2차 수정

2DU %!s(int64=8) %!d(string=hai) anos
pai
achega
37ea437eea
Modificáronse 2 ficheiros con 5 adicións e 2 borrados
  1. 1 1
      app.py
  2. 4 1
      mark.py

+ 1 - 1
app.py

@@ -966,7 +966,7 @@ def xref(name = None, num = 1):
     i = v - 50
     div = '<ul>'
     
-    curs.execute("select link, type from back where title = ? order by link asc limit ?, ?", [name, str(i), str(v)])
+    curs.execute("select link, type from back where title = ? and not type = 'no' order by link asc limit ?, ?", [name, str(i), str(v)])
     for data in curs.fetchall():
         div += '<li><a href="/w/' + url_pas(data[0]) + '">' + data[0] + '</a>'
         

+ 4 - 1
mark.py

@@ -539,6 +539,7 @@ def link(title, data, num, category):
                 else:                    
                     a = href.replace('&#x27;', "'").replace('&quot;', '"').replace('\\\\', '<slash>').replace('\\', '').replace('<slash>', '\\')
                     
+                    backlink_plus(title, a, '', num)
                     curs.execute("select title from data where title = ?", [a])
                     if(not curs.fetchall()):
                         no = 'class="not_thing"'
@@ -640,7 +641,9 @@ def namumark(title, data, num, in_c, toc_y):
         else:
             href = d
             
-        data = re.sub('\r\n#(?:redirect|넘겨주기) ((?:(?!\r|\n|%0D).)+)', '<meta http-equiv="refresh" content="0;url=/w/' + url_pas(href.replace('&#x27;', "'").replace('&quot;', '"').replace('\\\\', '<slash>').replace('\\', '').replace('<slash>', '\\')) + '/from/' + url_pas(title) + sh + '" />', data, 1)
+        a = href.replace('&#x27;', "'").replace('&quot;', '"').replace('\\\\', '<slash>').replace('\\', '').replace('<slash>', '\\')
+        backlink_plus(title, a, 'redirect', num)
+        data = re.sub('\r\n#(?:redirect|넘겨주기) ((?:(?!\r|\n|%0D).)+)', '<meta http-equiv="refresh" content="0;url=/w/' + url_pas(a) + '/from/' + url_pas(title) + sh + '" />', data, 1)
           
     data = re.sub("\[nicovideo\((?P<in>[^,)]*)(?:(?:,(?:[^,)]*))+)?\)\]", "[[http://embed.nicovideo.jp/watch/\g<in>]]", data)