MCPcopy Create free account
hub / github.com/pollinations/pollinations / _sanitize

Function _sanitize

social/scripts/common.py:1007–1014  ·  view source on GitHub ↗
(s: str)

Source from the content-addressed store, hash-verified

1005 # Sanitize for unquoted heredoc (shell expansion active)
1006 # Also strip newlines to prevent breaking TypeScript syntax
1007 def _sanitize(s: str) -> str:
1008 return (s
1009 .replace('\n', ' ').replace('\r', '')
1010 .replace('LINKEOF', '')
1011 .replace('\\', '\\\\')
1012 .replace('"', '\\"')
1013 .replace('$', '\\$')
1014 .replace('`', '\\`'))
1015
1016 sanitized_url = _sanitize(image_url)
1017 sanitized_title = _sanitize(title)

Callers 1

deploy_reddit_postFunction · 0.85

Calls 1

replaceMethod · 0.65

Tested by

no test coverage detected