Author: soliton
Date: Wed Jan 13 10:26:00 2010
New Revision: 40687
URL: http://svn.gna.org/viewcvs/wesnoth?rev=40687&view=rev
Log:
fixed listing logic
Modified:
trunk/data/tools/wmlscope
Modified: trunk/data/tools/wmlscope
URL:
http://svn.gna.org/viewcvs/wesnoth/trunk/data/tools/wmlscope?rev=40687&r1=40686&r2=40687&view=diff
==============================================================================
--- trunk/data/tools/wmlscope (original)
+++ trunk/data/tools/wmlscope Wed Jan 13 10:26:00 2010
@@ -101,22 +101,23 @@
outstr = '<p class="%s">' % css
for line in lines:
line = line.strip()
- if not inlisting and not line:
- outstr += "</p><p>"
- continue
- if not inlisting and line[0] == '!':
- outstr += "</p>\n<pre class='listing'>"
- inlisting = True
- bracketdepth = curlydepth = 0
+ if inlisting:
+ if line and line[0] != '!':
+ outstr += "</pre>\n<p>"
+ inlisting = False
+ else:
+ if not line:
+ outstr += "</p><p>"
+ continue
+ if line[0] == '!':
+ outstr += "</p>\n<pre class='listing'>"
+ inlisting = True
+ bracketdepth = curlydepth = 0
line = line.replace("<", "<").replace(">", ">").replace("&",
"&")
if inlisting:
outstr += line[1:] + "\n"
else:
outstr += line + "\n"
- if inlisting:
- if line and line[0] != '!':
- outstr += "</pre>\n<p>"
- inlisting = False
if not inlisting:
outstr += "</p>\n"
else:
_______________________________________________
Wesnoth-commits mailing list
[email protected]
https://mail.gna.org/listinfo/wesnoth-commits