Skip to content

Commit

Permalink
Fix handling ‎ and ‏ marks
Browse files Browse the repository at this point in the history
- mid-text within stressed tags
- right after stressed tags

Fixes Alir3z4#201.
  • Loading branch information
Unit03 committed Jul 15, 2018
1 parent bef7ec0 commit 802fad1
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 1 deletion.
7 changes: 7 additions & 0 deletions ChangeLog.rst
@@ -1,3 +1,10 @@
0000.00.00
==========
----

* Fix #201: handle ‎/‏ marks mid-text within stressed tags or right after stressed tags


2018.9.1
========
----
Expand Down
4 changes: 3 additions & 1 deletion html2text/__init__.py
Expand Up @@ -186,7 +186,9 @@ def handle_charref(self, c):
self.handle_data(self.charref(c), True)

def handle_entityref(self, c):
self.handle_data(self.entityref(c), True)
ref = self.entityref(c)
if ref:
self.handle_data(ref, True)

def handle_starttag(self, tag, attrs):
self.handle_tag(tag, attrs, 1)
Expand Down
1 change: 1 addition & 0 deletions test/lrm_after_i.html
@@ -0,0 +1 @@
<i>Foo</i>&lrm;
2 changes: 2 additions & 0 deletions test/lrm_after_i.md
@@ -0,0 +1,2 @@
_Foo_

1 change: 1 addition & 0 deletions test/lrm_inside_i.html
@@ -0,0 +1 @@
<i>Foo&lrm;bar</i>
2 changes: 2 additions & 0 deletions test/lrm_inside_i.md
@@ -0,0 +1,2 @@
_Foo bar_

1 change: 1 addition & 0 deletions test/rlm_inside_strong.html
@@ -0,0 +1 @@
<strong>Foo&rlm;bar</strong>
2 changes: 2 additions & 0 deletions test/rlm_inside_strong.md
@@ -0,0 +1,2 @@
**Foo bar**

0 comments on commit 802fad1

Please sign in to comment.