mirror of
https://github.com/placeAtlas/atlas.git
synced 2024-12-26 20:34:10 +01:00
Merge branch 'less-markdown-links' into cleanup
This commit is contained in:
commit
eb4c9e1209
2 changed files with 1273 additions and 1250 deletions
23
tools/less-md-links.py
Normal file
23
tools/less-md-links.py
Normal file
|
@ -0,0 +1,23 @@
|
|||
#!/usr/bin/python
|
||||
|
||||
import re
|
||||
pattern = re.compile(r'\[(.+?)\]\((.+?)\)')
|
||||
|
||||
def go(path):
|
||||
|
||||
with open(path, "r+", encoding='UTF-8') as f1:
|
||||
contents = f1.read()
|
||||
|
||||
for match in pattern.finditer(contents):
|
||||
if match.group(1) == match.group(2):
|
||||
contents = contents.replace(match.group(0), match.group(2), 1)
|
||||
|
||||
for match in pattern.finditer(contents):
|
||||
if match.group(1) == match.group(2):
|
||||
contents = contents.replace(match.group(0), match.group(2), 1)
|
||||
|
||||
with open(path, "w", encoding='UTF-8') as f2:
|
||||
f2.write(contents)
|
||||
|
||||
go("../web/atlas.json")
|
||||
go("../web/atlas-before-ids-migration.json")
|
File diff suppressed because it is too large
Load diff
Loading…
Reference in a new issue