(html)
| 130 | return parsed_objects, unparsed_segments |
| 131 | |
| 132 | def sanitize_html(html): |
| 133 | # Replace all unwanted and special characters with an empty string |
| 134 | sanitized_html = html |
| 135 | # sanitized_html = re.sub(r'[^\w\s.,;:!?=\[\]{}()<>\/\\\-"]', '', html) |
| 136 | |
| 137 | # Escape all double and single quotes |
| 138 | sanitized_html = sanitized_html.replace('"', '\\"').replace("'", "\\'") |
| 139 | |
| 140 | return sanitized_html |
| 141 | |
| 142 | def sanitize_input_encode(text: str) -> str: |
| 143 | """Sanitize input to handle potential encoding issues.""" |
no outgoing calls
no test coverage detected
searching dependent graphs…