safehtml 0.2.0

A high-performance, no_std Rust library for Type-Driven Security (XSS and injection prevention).
Documentation
import re

with open('tests/validation_tests.rs', 'r') as f:
    content = f.read()

imports = set([
    'INNOCUOUS_URL', 'SafeHtml', 'SafeUrl', 'coerce_to_interchange_valid_to',
    'escape_allow_character_references_to', 'escape_html_and_coerce_to', 'is_interchange_invalid',
    'is_safe_url_block_javascript', 'is_safe_url_restrictive', 'is_safe_url_restrictive_with_schemes',
    'percent_escape_css_url_to', 'safe_html_cat', 'SafeHtmlProto', 'coerce_bytes_to_interchange_valid',
    'url_encode_component', 'SafeScript', 'escape_json_for_script'
])

# Remove all `use safetypes::...`
content = re.sub(r'use safetypes::\{[^}]+\};\n', '', content)
content = re.sub(r'use safetypes::[a-zA-Z0-9_]+;\n', '', content)

new_use = 'use safetypes::{\n    ' + ', '.join(sorted(imports)) + ',\n};\n'

with open('tests/validation_tests.rs', 'w') as f:
    f.write(new_use + '\n' + content)