From 8a9f9acbaad884d967a5d6fdfdbb9c8ada576c18 Mon Sep 17 00:00:00 2001
From: Ian Gulliver
Date: Wed, 2 Jul 2014 13:42:17 -0700
Subject: [PATCH] Python: add > escaping
---
recentrunes.py | 5 ++++-
test.py | 4 ++--
2 files changed, 6 insertions(+), 3 deletions(-)
diff --git a/recentrunes.py b/recentrunes.py
index dca876e..8bf1b8c 100644
--- a/recentrunes.py
+++ b/recentrunes.py
@@ -20,7 +20,10 @@ class TextNode(object):
return self.textContent
def __str__(self):
- return self.textContent.replace('&', '&').replace('<', '<')
+ return (self.textContent
+ .replace('&', '&')
+ .replace('<', '<')
+ .replace('>', '>'))
class Element(object):
diff --git a/test.py b/test.py
index b36806e..34f6f89 100755
--- a/test.py
+++ b/test.py
@@ -47,7 +47,7 @@ This is strikethrough, as is this. Source
code looks like this. Fixed width text looks like
this. This sentence is inline pre-formatted, which stops
'''''this from being bold and italic.'''''
We can also
-stop <u>this from being underlined</u>, or just try
-<pre>interrupting cow style.</pre>This is a blockquote
Header 2
Header 3 with italics
Header 4
Header 5
Header 6
- Item 1a
- Item 1b
- Item 2
- Item 3
- Item 1c
I don't really understand what a definition isBut blockquotes are easy
Even larger onesAnd really huge onesThis line is pre-formatted and <del>not interpolated</del>
+stop <u>this from being underlined</u>, or just try
+<pre>interrupting cow style.</pre>This is a blockquote
Header 2
Header 3 with italics
Header 4
Header 5
Header 6
- Item 1a
- Item 1b
- Item 2
- Item 3
- Item 1c
I don't really understand what a definition isBut blockquotes are easy
Even larger onesAnd really huge onesThis line is pre-formatted and <del>not interpolated</del>
This line is also pre-formatted
"""