diff options
author | mathieui <mathieui@mathieui.net> | 2011-05-27 23:36:20 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2011-05-27 23:36:20 +0200 |
commit | 2d570a402887b01969b9422f9392813271a29866 (patch) | |
tree | 9a66008540d964921e4ee55a2094bd596c7d2e8d /src/xhtml.py | |
parent | 4a98792bbf6d2e9e020e0c48db9b98112ed4c9ca (diff) | |
download | poezio-2d570a402887b01969b9422f9392813271a29866.tar.gz poezio-2d570a402887b01969b9422f9392813271a29866.tar.bz2 poezio-2d570a402887b01969b9422f9392813271a29866.tar.xz poezio-2d570a402887b01969b9422f9392813271a29866.zip |
Fixes #2137 (altough it could have been done better)
Diffstat (limited to 'src/xhtml.py')
-rw-r--r-- | src/xhtml.py | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/xhtml.py b/src/xhtml.py index 29017be3..d755229f 100644 --- a/src/xhtml.py +++ b/src/xhtml.py @@ -71,7 +71,13 @@ def convert_links_to_plaintext(text): previous_child = None for child in parent: if child.tag == '{http://www.w3.org/1999/xhtml}a': - link_text = '\n%s (%s)'%(child.attrib['href'], child.text) + if child.attrib['href'] != child.text: + if child.text is None and 'title' in child.attrib: + link_text = '\n%s (%s)'%(child.attrib['href'], child.attrib['title']) + else: + link_text = '\n%s (%s)'%(child.attrib['href'], child.text) + else: + link_text = child.text if previous_child is not None: if previous_child.tail is None: previous_child.tail = link_text |