(match_string: str)
| 124 | |
| 125 | |
| 126 | def _desanitize_match_string(match_string: str) -> tuple[str, list[tuple[str, str]]]: |
| 127 | result = match_string |
| 128 | applied: list[tuple[str, str]] = [] |
| 129 | for from_str, to_str in _DESANITIZATIONS: |
| 130 | before = result |
| 131 | result = result.replace(from_str, to_str) |
| 132 | if before != result: |
| 133 | applied.append((from_str, to_str)) |
| 134 | return result, applied |
| 135 | |
| 136 | |
| 137 | # -- Smart edit application ---------------------------------------------------- |