MCPcopy Create free account
hub / github.com/ElementsProject/lightning / esc_underscores

Function esc_underscores

tools/fromschema.py:23–25  ·  view source on GitHub ↗

Backslash-escape underscores outside of backtick-enclosed spans

(s)

Source from the content-addressed store, hash-verified

21
22
23def esc_underscores(s):
24 """Backslash-escape underscores outside of backtick-enclosed spans"""
25 return ''.join(['\\_' if x == '_' else x for x in re.findall(r'(?ms:^[ \t]*```.*?^[ \t]*```)|[^`_\\\n]+|`(?:[^`\\]|\\.)*`|\\.|[_\n]', s)])
26
27
28def json_value(obj):

Callers 10

json_valueFunction · 0.85
outputsFunction · 0.85
output_typeFunction · 0.85
fmt_propnameFunction · 0.85
fmt_paramnameFunction · 0.85
output_memberFunction · 0.85
output_arrayFunction · 0.85
generate_headerFunction · 0.85
generate_footerFunction · 0.85

Calls 1

joinMethod · 0.80

Tested by

no test coverage detected