Compare commits
1 commit
8c8e4b8433
...
ec6bc85b08
Author | SHA1 | Date | |
---|---|---|---|
![]() |
ec6bc85b08 |
1 changed files with 4 additions and 3 deletions
7
nodes.py
7
nodes.py
|
@ -10,9 +10,10 @@ converters = {
|
||||||
|
|
||||||
def demagify(data):
|
def demagify(data):
|
||||||
if isinstance(data, str):
|
if isinstance(data, str):
|
||||||
for name, converter in converters.items():
|
match = search(r'^\!([0-9a-zA-Z_-]{,255})\:(.*)$', data)
|
||||||
if data.startswith(f'!{name}:'):
|
if match:
|
||||||
return converter(data[len(name) + 2:])
|
magicstring, content = match.groups()
|
||||||
|
return converters[magicstring](content)
|
||||||
else:
|
else:
|
||||||
return data
|
return data
|
||||||
elif isinstance(data, dict):
|
elif isinstance(data, dict):
|
||||||
|
|
Loading…
Reference in a new issue