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