Browse Source

버그 수정

2DU 9 năm trước cách đây
mục cha
commit
802bb3ebea
1 tập tin đã thay đổi với 3 bổ sung4 xóa
  1. 3 4
      app.py

+ 3 - 4
app.py

@@ -206,7 +206,7 @@ def namumark(title, data):
                 else:
                 else:
                     height = ''
                     height = ''
                 img = re.sub("\.(?P<in>jpg|png|gif|jpeg)", "#\g<in>#", c[0])
                 img = re.sub("\.(?P<in>jpg|png|gif|jpeg)", "#\g<in>#", c[0])
-                data = re.sub("\[\[파일:((?:(?!\]\]|\?).)*)(?:\?((?:(?!\]\]).)*))?\]\]", '<img src="/image/' + img + '" style="width:' + width + ';height:' + height + ';">', data, 1)
+                data = re.sub("\[\[파일:((?:(?!\]\]|\?).)*)(?:\?((?:(?!\]\]).)*))?\]\]", '<img src="/image/' + img + '" width="' + width + '" height="' + height + '">', data, 1)
             else:
             else:
                 img = re.sub("\.(?P<in>jpg|png|gif|jpeg)", "#\g<in>#", c[0])
                 img = re.sub("\.(?P<in>jpg|png|gif|jpeg)", "#\g<in>#", c[0])
                 data = re.sub("\[\[파일:((?:(?!\]\]|\?).)*)(?:\?((?:(?!\]\]).)*))?\]\]", "<img src='/image/" + img + "'>", data, 1)
                 data = re.sub("\[\[파일:((?:(?!\]\]|\?).)*)(?:\?((?:(?!\]\]).)*))?\]\]", "<img src='/image/" + img + "'>", data, 1)
@@ -241,9 +241,8 @@ def namumark(title, data):
             break
             break
             
             
     while True:
     while True:
-        m = re.search("http(?:s)?:\/\/(?:(?:(?:(?!\.jpg|\.png|\.gif|\.jpeg|#jpg#|#png#|#gif#|#jpeg#).)*)(?:\.jpg|\.png|\.gif|\.jpeg))(?:(?:(?:\?)width=((?:[0-9]*)(?:px)?))?(?:(?:\?|&)height=((?:[0-9]*)(?:px)?))?(?:(?:&)width=((?:[0-9]*)(?:px)?))?)?", data)
+        m = re.search("(http(?:s)?:\/\/(?:(?:(?:(?!\.jpg|\.png|\.gif|\.jpeg|#jpg#|#png#|#gif#|#jpeg#).)*)(?:\.jpg|\.png|\.gif|\.jpeg)))(?:(?:(?:\?)width=((?:[0-9]*)(?:px)?))?(?:(?:\?|&)height=((?:[0-9]*)(?:px)?))?(?:(?:&)width=((?:[0-9]*)(?:px)?))?)?", data)
         if(m):
         if(m):
-            print(m)
             result = m.groups()
             result = m.groups()
             if(result[1]):
             if(result[1]):
                 if(result[2]):
                 if(result[2]):
@@ -264,7 +263,7 @@ def namumark(title, data):
                 height = ''
                 height = ''
             c = result[0]
             c = result[0]
             c = re.sub("\.(?P<in>jpg|png|gif|jpeg)", "#\g<in>#", c)
             c = re.sub("\.(?P<in>jpg|png|gif|jpeg)", "#\g<in>#", c)
-            data = re.sub("http(?:s)?:\/\/(?:(?:(?:(?!\.jpg|\.png|\.gif|\.jpeg|#jpg#|#png#|#gif#|#jpeg#).)*)(?:\.jpg|\.png|\.gif|\.jpeg))(?:(?:(?:\?)width=((?:[0-9]*)(?:px)?))?(?:(?:\?|&)height=((?:[0-9]*)(?:px)?))?(?:(?:&)width=((?:[0-9]*)(?:px)?))?)?", "<img style='width:" + width + ";height:" + height + ";' src='" + c + "'>", data, 1)
+            data = re.sub("(http(?:s)?:\/\/(?:(?:(?:(?!\.jpg|\.png|\.gif|\.jpeg|#jpg#|#png#|#gif#|#jpeg#).)*)(?:\.jpg|\.png|\.gif|\.jpeg)))(?:(?:(?:\?)width=((?:[0-9]*)(?:px)?))?(?:(?:\?|&)height=((?:[0-9]*)(?:px)?))?(?:(?:&)width=((?:[0-9]*)(?:px)?))?)?", "<img width='" + width + "' height='" + height + "' src='" + c + "'>", data, 1)
         else:
         else:
             break
             break