Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
from html import escape
html_string = '''
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<p>This is a sample string! </p>
</body>
</html>
'''
escaped_string = escape(html_string)
print(escaped_string)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.