init
Browse files
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)
|