MCPcopy Create free account
hub / github.com/ronreiter/interactive-tutorials / dequote

Function dequote

markdown/inlinepatterns.py:94–100  ·  view source on GitHub ↗

Remove quotes from around a string.

(string)

Source from the content-addressed store, hash-verified

92
93
94def dequote(string):
95 """Remove quotes from around a string."""
96 if ( ( string.startswith('"') and string.endswith('"'))
97 or (string.startswith("'") and string.endswith("'")) ):
98 return string[1:-1]
99 else:
100 return string
101
102ATTR_RE = re.compile("\{@([^\}]*)=([^\}]*)}") # {@id=123}
103

Callers 2

handleMatchMethod · 0.85
handleMatchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected