MCPcopy Create free account
hub / github.com/codenameone/CodenameOne / _transform_prose_text

Function _transform_prose_text

scripts/website/bulk_mechanical_fix.py:56–63  ·  view source on GitHub ↗

Apply enabled transforms to a run of plain prose (no protected spans).

(text, opts, counts)

Source from the content-addressed store, hash-verified

54
55
56def _transform_prose_text(text, opts, counts):
57 """Apply enabled transforms to a run of plain prose (no protected spans)."""
58 if opts["collapse_spaces"]:
59 new = re.sub(r"(?<=\S) +(?=\S)", " ", text)
60 if new != text:
61 counts["collapse-spaces"] += 1
62 text = new
63 return text
64
65
66def _transform_line(line, opts, counts):

Callers 1

_transform_lineFunction · 0.85

Calls 1

subMethod · 0.45

Tested by

no test coverage detected