(s: str)
| 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) |
no test coverage detected