From 07fcd01699e0b67f5a822514d4fcfab4b3c70ff0 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 23 Oct 2010 14:46:08 -0400 Subject: internal links, punctuation & parentheses issue, fix * dal, exclude parentheses and square brackets from matching (requested fix, Ben Armstrong) * html, remove space between link & following punctuation, parentheses &/or square brackets (requested fix, Ben Armstrong) * epub, remove space between link & following punctuation, parentheses &/or square brackets --- lib/sisu/v2/epub_tune.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/sisu/v2/epub_tune.rb') diff --git a/lib/sisu/v2/epub_tune.rb b/lib/sisu/v2/epub_tune.rb index 90bf9575..8ef19f19 100644 --- a/lib/sisu/v2/epub_tune.rb +++ b/lib/sisu/v2/epub_tune.rb @@ -333,7 +333,7 @@ module SiSU_EPUB_Tune %{}) end if dob.obj =~/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}|image)/ - @word_mode=dob.obj.scan(/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}|image)[.,;:!?)\]]?|(?:#{Mx[:gl_o]}\S+?#{Mx[:gl_c]})+|[^#{Mx[:lnk_o]}#{Mx[:lnk_c]}]+/mu) + @word_mode=dob.obj.scan(/#{Mx[:lnk_o]}.+?#{Mx[:lnk_c]}(?:#{Mx[:url_o]}\S+?#{Mx[:url_c]}|#{Mx[:rel_o]}\S+?#{Mx[:rel_c]}|image)[()\[\]]*[.,;:!?]?|(?:#{Mx[:gl_o]}\S+?#{Mx[:gl_c]})+|[^#{Mx[:lnk_o]}#{Mx[:lnk_c]}]+/mu) words=urls(@word_mode) dob.obj.gsub!(/.+/m,words) end -- cgit v1.2.3