Skip to content

Commit

Permalink
Fixed terrain2wiki script not working with certain comments
Browse files Browse the repository at this point in the history
The script errored if a comment not starting at the start of the line was found in the cfg file.
  • Loading branch information
Elvish-Hunter committed Jun 22, 2016
1 parent d80c80a commit fccd419
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions data/tools/terrain2wiki.py
Expand Up @@ -38,8 +38,8 @@ def parse_terrain(data):
"""

# Remove all comments.
data = "\n".join([i for i in data.split("\n") if not i.startswith("#")])
terrains = re.compile("\[terrain_type\](.*?)\[\/terrain_type\]", re.DOTALL).findall(data)
data = "\n".join([i for i in data.split("\n") if not re.match("^\s*#", i)])
terrains = re.compile(r"\[terrain_type\](.*?)\[\/terrain_type\]", re.DOTALL).findall(data)

data = """{{AutogeneratedWML}}{| border="1"
!terrain
Expand Down

0 comments on commit fccd419

Please sign in to comment.