Fixed terrain2wiki script not working with certain comments
The script errored if a comment not starting at the start of the line was found in the cfg file.
This commit is contained in:
parent
d80c80a50f
commit
fccd419429
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue