diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/sisu/v2/epub_format.rb | 6 | ||||
-rw-r--r-- | lib/sisu/v2/html_format.rb | 6 |
2 files changed, 12 insertions, 0 deletions
diff --git a/lib/sisu/v2/epub_format.rb b/lib/sisu/v2/epub_format.rb index a10493ca..350e6f2c 100644 --- a/lib/sisu/v2/epub_format.rb +++ b/lib/sisu/v2/epub_format.rb @@ -1903,7 +1903,13 @@ WOK </p> } end + def clean(txt) + txt.gsub!(/#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}/,'') + txt.gsub!(/#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]}/,'') + txt + end def subtoc_lev(tag,attrib) + @txt=clean(@txt) txt=if @txt \ and @txt =~/<\/?i>|<a\s+name="\S+?">/mi @txt.gsub(/<\/?i>|<a\s+name="\S+?">/mi,'') #removes name markers from subtoc, go directly to substantive text diff --git a/lib/sisu/v2/html_format.rb b/lib/sisu/v2/html_format.rb index 1cd5104f..47472406 100644 --- a/lib/sisu/v2/html_format.rb +++ b/lib/sisu/v2/html_format.rb @@ -1274,7 +1274,13 @@ WOK </p> } end + def clean(txt) + txt.gsub!(/#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}/,'') + txt.gsub!(/#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]}/,'') + txt + end def subtoc_lev(tag,attrib) + @txt=clean(@txt) txt=if @txt \ and @txt =~/<\/?i>|<a\s+name="\S+?">/mi @txt.gsub(/<\/?i>|<a\s+name="\S+?">/mi,'') #removes name markers from subtoc, go directly to substantive text |