Surplus_Up (2DU) преди 7 години
родител
ревизия
7828deb7d3
променени са 1 файла, в които са добавени 2 реда и са изтрити 2 реда
  1. 2 2
      set_mark/namu.py

+ 2 - 2
set_mark/namu.py

@@ -585,8 +585,8 @@ def namu(conn, data, title, main_num):
     anchor_re = re.compile("\[anchor\((?P<in>(?:(?!\)\]).)+)\)\]", re.I)
     anchor_re = re.compile("\[anchor\((?P<in>(?:(?!\)\]).)+)\)\]", re.I)
     data = anchor_re.sub('<span id="\g<in>"></span>', data)
     data = anchor_re.sub('<span id="\g<in>"></span>', data)
 
 
-    ruby_re = re.compile("\[ruby\((?P<in>(?:(?!,).)+)\, ?(?P<out>(?:(?!\)\]).)+)\)\]", re.I)
-    data = ruby_re.sub('<ruby>\g<in><rp>(</rp><rt>\g<out></rt><rp>)</rp></ruby>', data)
+    ruby_re = re.compile("\[ruby\((?P<in>(?:(?!,).)+)\, ?ruby=(?P<out>(?:(?!\)\]|,).)+)(?:\, ?color=(?P<under>(?:(?!\)\]).)+))?\)\]", re.I)
+    data = ruby_re.sub('<ruby>\g<in><rp>(</rp><rt style="color: \g<under>">\g<out></rt><rp>)</rp></ruby>', data)
 
 
     now_time = tool.get_time()
     now_time = tool.get_time()