psyche commited on
Commit
e748d00
1 Parent(s): e818d15
Files changed (1) hide show
  1. kowiki.py +5 -0
kowiki.py CHANGED
@@ -57,6 +57,11 @@ def remove_double_bracket_text(text):
57
  text = re.sub("\{\{([^|\{\}]+)\}\}", "\\1", text)
58
  text = re.sub("\{\{ll?ang\|[a-z]+\|([^\{\}]+)\}\}", "\\1", text)
59
  text = re.sub("\{\{[^\=]+\|([^\=\{\}]+)\}\}", "\\1", text)
 
 
 
 
 
60
  #text = re.sub("\{\{[^\{\}]+\|([^\{\}]+)\}\}" , "\\1", text)
61
  #text = re.sub("\{\{[^\}]+\|([0-9]\=[^\}]+)\}\}", "'\\1'", text)
62
  #text = re.sub("\{\{[^\}]+\|([^\}]+)\}\}", "\\1", text)
 
57
  text = re.sub("\{\{([^|\{\}]+)\}\}", "\\1", text)
58
  text = re.sub("\{\{ll?ang\|[a-z]+\|([^\{\}]+)\}\}", "\\1", text)
59
  text = re.sub("\{\{[^\=]+\|([^\=\{\}]+)\}\}", "\\1", text)
60
+ matched = re.search("{{([^\|\{\}]+)\n\|([^\}]+)\}\}", text)
61
+ if matched is not None:
62
+ s,e = matched.span()
63
+ values = matched.group(2).split("\n|")
64
+ text = text[:s] + matched.group(1) + values[0] + text[e:]
65
  #text = re.sub("\{\{[^\{\}]+\|([^\{\}]+)\}\}" , "\\1", text)
66
  #text = re.sub("\{\{[^\}]+\|([0-9]\=[^\}]+)\}\}", "'\\1'", text)
67
  #text = re.sub("\{\{[^\}]+\|([^\}]+)\}\}", "\\1", text)