Răsfoiți Sursa

Merge pull request #29 from 2DU/unstable

리그베다 위키 문법 수용
2DU 9 ani în urmă
părinte
comite
f972103e83
2 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 1 0
      func.py
  2. 1 1
      mark.py

+ 1 - 0
func.py

@@ -43,6 +43,7 @@ def diff(seqm):
             output.append("<span style='background:#CFC;'>" + seqm.b[b0:b1] + "</span><span style='background:#FDD;'>" + seqm.a[a0:a1] + "</span>")
         else:
             output.append(seqm.a[a0:a1])
+            
     return ''.join(output)
            
 def admin_check():

+ 1 - 1
mark.py

@@ -499,7 +499,7 @@ def namumark(title, data):
     data = re.sub("\[br\]",'<br>', data)
     
     while(True):
-        com = re.compile("\[youtube\(((?:(?!,|\)\]).)*)(?:,(?:\s)?)?(?:width=((?:(?!,|\)\]).)*))?(?:,(?:\s)?)?(?:height=((?:(?!,|\)\]).)*))?\)\]")
+        com = re.compile("\[youtube\((?:https:\/\/www\.youtube\.com\/watch\?v=|https:\/\/youtu\.be\/)?((?:(?!,|\)\]).)*)(?:,(?:\s)?)?(?:width=((?:(?!,|\)\]).)*))?(?:,(?:\s)?)?(?:height=((?:(?!,|\)\]).)*))?\)\]")
         m = com.search(data)
         if(m):
             result = m.groups()