From 41b812e57a53a2753677854a24a924b06d6af1d5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 21 Oct 2010 21:12:29 -0400 Subject: html, internal link: remove space between link & following punctuation (requested fix, Ben Armstrong) --- lib/sisu/v2/html_tune.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sisu/v2/html_tune.rb b/lib/sisu/v2/html_tune.rb index f4ad532f..12501d6c 100644 --- a/lib/sisu/v2/html_tune.rb +++ b/lib/sisu/v2/html_tune.rb @@ -305,7 +305,7 @@ module SiSU_HTML_Tune data.each do |dob| unless dob.is=='code' 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 #consider change, do a while loop -- cgit v1.2.3 From 7da9ff242fd4d9294020ac113202b68b86fb51fa Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Thu, 21 Oct 2010 21:15:42 -0400 Subject: epub, internal link: remove space between link & following punctuation --- lib/sisu/v2/epub_tune.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sisu/v2/epub_tune.rb b/lib/sisu/v2/epub_tune.rb index e0c1e029..c47e78b4 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 From fda25aa07788a45272285b9832e94629174fd345 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 22 Oct 2010 18:30:22 -0400 Subject: dal, internal link: exclude parentheses and square brackets from matching (requested fix, Ben Armstrong) --- lib/sisu/v2/dal_syntax.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/dal_syntax.rb b/lib/sisu/v2/dal_syntax.rb index fbc62158..c4059fa8 100644 --- a/lib/sisu/v2/dal_syntax.rb +++ b/lib/sisu/v2/dal_syntax.rb @@ -384,11 +384,11 @@ module SiSU_Syntax "\\1#{Mx[:lnk_o]}\\2#{Mx[:lnk_c]}\\3") #linked (text or image, however text cannot include modified face, e.g. bold, ital, underline) dob.obj.gsub!(/(^|[#{Mx[:gl_c]}#{Mx[:lnk_c]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}(\s])((?:https?|ftp):\/\/\S+?\.[^>< ]+?)([,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{\\1#{Mx[:url_o]}\\2#{Mx[:url_c]}\\3}) - dob.obj.gsub!(/#{Mx[:lnk_c]}#(\S+?[^>< ]+?)([,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, + dob.obj.gsub!(/#{Mx[:lnk_c]}#(\S+?[^>< ]+?)([,.;'"()\[\]]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{#{Mx[:lnk_c]}#{Mx[:rel_o]}\\1#{Mx[:rel_c]}\\2}) - dob.obj.gsub!(/#{Mx[:lnk_c]}:(\S+?[^>< ]+?)([,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, + dob.obj.gsub!(/#{Mx[:lnk_c]}:(\S+?[^>< ]+?)([,.;'"()\[\]]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{#{Mx[:lnk_c]}#{Mx[:rel_o]}:\\1#{Mx[:rel_c]}\\2}) - dob.obj.gsub!(/#{Mx[:lnk_c]}[.]{2}\/(\S+?[^>< ]+?)([,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, + dob.obj.gsub!(/#{Mx[:lnk_c]}[.]{2}\/(\S+?[^>< ]+?)([,.;'"()\[\]]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{#{Mx[:lnk_c]}#{Mx[:rel_o]}:\\1#{Mx[:rel_c]}\\2}) end if dob.obj=~/_(?:https?|ftp):\S+/m # _http://url #CHECK -- cgit v1.2.3 From 6632e4350372f26572038bdf02d0bf584e3c6945 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 22 Oct 2010 18:32:18 -0400 Subject: html, internal link: remove space between link & parentheses or square brackets --- lib/sisu/v2/html_tune.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sisu/v2/html_tune.rb b/lib/sisu/v2/html_tune.rb index 12501d6c..eddd3049 100644 --- a/lib/sisu/v2/html_tune.rb +++ b/lib/sisu/v2/html_tune.rb @@ -305,7 +305,7 @@ module SiSU_HTML_Tune data.each do |dob| unless dob.is=='code' 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 #consider change, do a while loop -- cgit v1.2.3 From b2918451e29c81a80c5a4a8b016df5765096e35b Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 22 Oct 2010 18:33:15 -0400 Subject: epub, internal link: remove space between link & parentheses or square brackets --- lib/sisu/v2/epub_tune.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/sisu/v2/epub_tune.rb b/lib/sisu/v2/epub_tune.rb index c47e78b4..90bf9575 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 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/dal_syntax.rb | 6 +++--- lib/sisu/v2/epub_tune.rb | 2 +- lib/sisu/v2/html_tune.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/dal_syntax.rb b/lib/sisu/v2/dal_syntax.rb index c4059fa8..e56d4a26 100644 --- a/lib/sisu/v2/dal_syntax.rb +++ b/lib/sisu/v2/dal_syntax.rb @@ -384,11 +384,11 @@ module SiSU_Syntax "\\1#{Mx[:lnk_o]}\\2#{Mx[:lnk_c]}\\3") #linked (text or image, however text cannot include modified face, e.g. bold, ital, underline) dob.obj.gsub!(/(^|[#{Mx[:gl_c]}#{Mx[:lnk_c]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}(\s])((?:https?|ftp):\/\/\S+?\.[^>< ]+?)([,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{\\1#{Mx[:url_o]}\\2#{Mx[:url_c]}\\3}) - dob.obj.gsub!(/#{Mx[:lnk_c]}#(\S+?[^>< ]+?)([,.;'"()\[\]]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, + dob.obj.gsub!(/#{Mx[:lnk_c]}#(\S+?[^>< ]+?)([()\[\]]*[,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{#{Mx[:lnk_c]}#{Mx[:rel_o]}\\1#{Mx[:rel_c]}\\2}) - dob.obj.gsub!(/#{Mx[:lnk_c]}:(\S+?[^>< ]+?)([,.;'"()\[\]]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, + dob.obj.gsub!(/#{Mx[:lnk_c]}:(\S+?[^>< ]+?)([()\[\]]*[,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{#{Mx[:lnk_c]}#{Mx[:rel_o]}:\\1#{Mx[:rel_c]}\\2}) - dob.obj.gsub!(/#{Mx[:lnk_c]}[.]{2}\/(\S+?[^>< ]+?)([,.;'"()\[\]]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, + dob.obj.gsub!(/#{Mx[:lnk_c]}[.]{2}\/(\S+?[^>< ]+?)([()\[\]]*[,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{#{Mx[:lnk_c]}#{Mx[:rel_o]}:\\1#{Mx[:rel_c]}\\2}) end if dob.obj=~/_(?:https?|ftp):\S+/m # _http://url #CHECK 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 diff --git a/lib/sisu/v2/html_tune.rb b/lib/sisu/v2/html_tune.rb index eddd3049..65a66844 100644 --- a/lib/sisu/v2/html_tune.rb +++ b/lib/sisu/v2/html_tune.rb @@ -305,7 +305,7 @@ module SiSU_HTML_Tune data.each do |dob| unless dob.is=='code' 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 #consider change, do a while loop -- cgit v1.2.3 From 0528ba40b3517a34e61beecad30266ec6b3a46b6 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sat, 23 Oct 2010 18:38:51 -0400 Subject: internal links, punctuation & parentheses issue, refix --- lib/sisu/v2/dal_syntax.rb | 6 +++--- lib/sisu/v2/epub_tune.rb | 2 +- lib/sisu/v2/html_tune.rb | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/dal_syntax.rb b/lib/sisu/v2/dal_syntax.rb index e56d4a26..01604b65 100644 --- a/lib/sisu/v2/dal_syntax.rb +++ b/lib/sisu/v2/dal_syntax.rb @@ -384,11 +384,11 @@ module SiSU_Syntax "\\1#{Mx[:lnk_o]}\\2#{Mx[:lnk_c]}\\3") #linked (text or image, however text cannot include modified face, e.g. bold, ital, underline) dob.obj.gsub!(/(^|[#{Mx[:gl_c]}#{Mx[:lnk_c]}#{Mx[:en_a_o]}#{Mx[:en_b_o]}(\s])((?:https?|ftp):\/\/\S+?\.[^>< ]+?)([,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{\\1#{Mx[:url_o]}\\2#{Mx[:url_c]}\\3}) - dob.obj.gsub!(/#{Mx[:lnk_c]}#(\S+?[^>< ]+?)([()\[\]]*[,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, + dob.obj.gsub!(/#{Mx[:lnk_c]}#(\S+?[^>< ]+?)([()\[\]]*[,.;:!?'"]{0,2})(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{#{Mx[:lnk_c]}#{Mx[:rel_o]}\\1#{Mx[:rel_c]}\\2}) - dob.obj.gsub!(/#{Mx[:lnk_c]}:(\S+?[^>< ]+?)([()\[\]]*[,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, + dob.obj.gsub!(/#{Mx[:lnk_c]}:(\S+?[^>< ]+?)([()\[\]]*[,.;:!?'"]{0,2})(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{#{Mx[:lnk_c]}#{Mx[:rel_o]}:\\1#{Mx[:rel_c]}\\2}) - dob.obj.gsub!(/#{Mx[:lnk_c]}[.]{2}\/(\S+?[^>< ]+?)([()\[\]]*[,.;'"]?)(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, + dob.obj.gsub!(/#{Mx[:lnk_c]}[.]{2}\/(\S+?[^>< ]+?)([()\[\]]*[,.;:!?'"]{0,2})(?=[\s#{Mx[:en_a_c]}#{Mx[:en_b_c]}#{Mx[:br_line]}#{Mx[:br_paragraph]}#{Mx[:br_nl]}]|$)/m, %{#{Mx[:lnk_c]}#{Mx[:rel_o]}:\\1#{Mx[:rel_c]}\\2}) end if dob.obj=~/_(?:https?|ftp):\S+/m # _http://url #CHECK diff --git a/lib/sisu/v2/epub_tune.rb b/lib/sisu/v2/epub_tune.rb index 8ef19f19..10583936 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)[()\[\]]*[,.;:!?'"]{0,2}|(?:#{Mx[:gl_o]}\S+?#{Mx[:gl_c]})+|[^#{Mx[:lnk_o]}#{Mx[:lnk_c]}]+/mu) words=urls(@word_mode) dob.obj.gsub!(/.+/m,words) end diff --git a/lib/sisu/v2/html_tune.rb b/lib/sisu/v2/html_tune.rb index 65a66844..9d3dce0b 100644 --- a/lib/sisu/v2/html_tune.rb +++ b/lib/sisu/v2/html_tune.rb @@ -305,7 +305,7 @@ module SiSU_HTML_Tune data.each do |dob| unless dob.is=='code' 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)[()\[\]]*[,.;:!?'"]{0,2}|(?:#{Mx[:gl_o]}\S+?#{Mx[:gl_c]})+|[^#{Mx[:lnk_o]}#{Mx[:lnk_c]}]+/mu) words=urls(@word_mode) dob.obj.gsub!(/.+/m,words) end #consider change, do a while loop -- cgit v1.2.3 From 8b2317a50995331aeb7a11dcb0bf52eb518195d9 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 24 Oct 2010 08:56:22 -0400 Subject: html, remove "copy @" mark (requested, Daniel Baumann) --- lib/sisu/v2/html.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/html.rb b/lib/sisu/v2/html.rb index 309297df..04406e48 100644 --- a/lib/sisu/v2/html.rb +++ b/lib/sisu/v2/html.rb @@ -545,8 +545,6 @@ WOK toc_shared << format_txt_obj.center_bold @segtoc << format_txt_obj.center_bold end - toc_shared << format_head_toc.copyat - @segtoc << format_head_toc.copyat toc_shared << "#{@vz.table_close*1}\n" @segtoc << "#{@vz.table_close*1}\n" tmp_head=nil -- cgit v1.2.3 From f0776648316c5f54e27bcd5b4c8ee50b57e6489c Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 24 Oct 2010 16:34:22 -0400 Subject: html segments, title banner (including "copy @" mark) configurable, boolean * true/false (config.yml commented out, default false) (requested off option, Daniel Baumann) --- lib/sisu/v2/html_segments.rb | 22 +++++++++++++++++----- lib/sisu/v2/sysenv.rb | 6 ++++++ 2 files changed, 23 insertions(+), 5 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/html_segments.rb b/lib/sisu/v2/html_segments.rb index 33e56402..a516d809 100644 --- a/lib/sisu/v2/html_segments.rb +++ b/lib/sisu/v2/html_segments.rb @@ -64,6 +64,7 @@ module SiSU_HTML_seg class Seg_output def initialize(md,outputfile,seg,minitoc,type='') @md,@output_seg_file,@seg,@minitoc,@type=md,outputfile,seg,minitoc,type + @title_banner_=SiSU_Env::Create_site.new(@md.cmd).html_seg_title_banner? end def output if @seg[:title] =~/\S/ @@ -72,7 +73,9 @@ module SiSU_HTML_seg if @type=='endnotes' @seg[:headings]=[] format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) - @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) + if @title_banner_ + @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) + end txt_obj={:txt =>'Endnotes',:ocn_display =>''} format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 @@ -80,7 +83,9 @@ module SiSU_HTML_seg elsif @type=='idx' @seg[:headings]=[] format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) - @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) + if @title_banner_ + @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) + end txt_obj={:txt =>'Index',:ocn_display =>''} format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 @@ -89,7 +94,9 @@ module SiSU_HTML_seg metadata=Metadata::Summary.new(@md).xhtml_display.metadata @seg[:headings]=[] format_head_seg=SiSU_HTML_Format::Head_seg.new(@md) - @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) + if @title_banner_ + @seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author) + end txt_obj={:txt =>'Metadata',:ocn_display =>''} format_seg=SiSU_HTML_Format::Format_seg.new(@md,txt_obj) @seg[:headings] << format_seg.title_heading1 @@ -122,11 +129,14 @@ module SiSU_HTML_seg @@dp,@@segtocband=nil,nil @@fns_previous='' attr_reader :seg_name_html,:seg_name_html_tracker - def initialize(md='',data='') + def initialize(md=nil,data='') @md,@data=md,data @vz=SiSU_Env::Get_init.instance.skin @seg_name_html=@@seg_name_html || nil @seg_name_html_tracker=@@tracker || nil + if @md + @title_banner_=SiSU_Env::Create_site.new(@md.cmd).html_seg_title_banner? + end end def songsheet begin @@ -299,7 +309,9 @@ module SiSU_HTML_seg end @@seg[:tocband_bannerless] << '
' << conditional_div_close << format_head_seg.navigation_band_bottom(@@segtocband,@@seg[:dot_nav]) @@seg[:headings] << format_head_seg.seg_head_escript if SiSU_HTML_Format::Head_seg.method_defined? :seg_head_escript #debug PHP move up in text #bug - @@seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author).gsub(clean,'') + if @title_banner_ + @@seg[:headings] << format_head_seg.title_banner(@md.title.main,@md.title.sub,@author).gsub(clean,'') + end ocn=if @@heading1[/.+?#{Mx[:id_o]}~(\d+);(?:[oh]|[0-6]:)\d+;\w\d+#{Mx[:id_c]}#{Mx[:id_o]}#{@dp}:#{@dp}#{Mx[:id_c]}$/]; $1 #fix else '' end diff --git a/lib/sisu/v2/sysenv.rb b/lib/sisu/v2/sysenv.rb index 395559a8..f61b1fcd 100644 --- a/lib/sisu/v2/sysenv.rb +++ b/lib/sisu/v2/sysenv.rb @@ -3260,6 +3260,12 @@ WOK filename_homepage_toc << @vz_home.homepage end end + def html_seg_title_banner? + ((defined? @rc['html']['seg_title_banner']) \ + && @rc['html']['seg_title_banner']==true) \ + ? @rc['html']['seg_title_banner'] \ + : false + end def cp_images(src_path,dest_path) if FileTest.directory?(src_path) cd(src_path) -- cgit v1.2.3 From ed1a104164b53dba74a2220ae99fea52ae8ff77e Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 24 Oct 2010 16:48:44 -0400 Subject: html, quick ref links_guide configurable, boolean * true/false (config.yml commented out, default false) (requested off option, Daniel Baumann) --- lib/sisu/v2/html.rb | 36 ++++++++++++++++++++---------------- lib/sisu/v2/html_format.rb | 4 ++-- lib/sisu/v2/sysenv.rb | 6 ++++++ 3 files changed, 28 insertions(+), 18 deletions(-) (limited to 'lib') diff --git a/lib/sisu/v2/html.rb b/lib/sisu/v2/html.rb index 04406e48..c984a858 100644 --- a/lib/sisu/v2/html.rb +++ b/lib/sisu/v2/html.rb @@ -162,29 +162,33 @@ module SiSU_HTML @links_guide_toc=[] def initialize(data,md) @data,@md=data,md + @links_guide_=SiSU_Env::Create_site.new(@md.cmd).html_quick_ref? end def toc @links_guide_toc=[] - format_head_toc=SiSU_HTML_Format::Head_toc.new(@md) - guide_type='horzontal' #values: horizontal or vertical - @links_guide_toc << format_head_toc.links_guide_open(guide_type) - if defined? @md.lnk \ - and @md.lnk - @md.lnk.each do |l| - if defined? l[:say] - target=if l[:url] !~/^\.(\.)?\//; 'external' - else '_top' + if @links_guide_ + format_head_toc=SiSU_HTML_Format::Head_toc.new(@md) + guide_type='horzontal' #values: horizontal or vertical + @links_guide_toc << format_head_toc.links_guide_open(guide_type) + if defined? @md.lnk \ + and @md.lnk + @md.lnk.each do |l| + if defined? l[:say] + target=if l[:url] !~/^\.(\.)?\//; 'external' + else '_top' + end + s_lnk_url,s_lnk_lnk=l[:url],l[:say] + txt_obj={:lnk_url =>s_lnk_url,:lnk_txt =>s_lnk_lnk,:target =>target} + lev_dob_ocn=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) + @links_guide_toc << lev_dob_ocn.links_guide if s_lnk_lnk end - s_lnk_url,s_lnk_lnk=l[:url],l[:say] - txt_obj={:lnk_url =>s_lnk_url,:lnk_txt =>s_lnk_lnk,:target =>target} - lev_dob_ocn=SiSU_HTML_Format::Format_toc.new(@md,txt_obj) - @links_guide_toc << lev_dob_ocn.links_guide if s_lnk_lnk end end + format_head_toc=SiSU_HTML_Format::Head_toc.new(@md) + @links_guide_toc << format_head_toc.links_guide_close #(guide_type) + @links_guide_toc + else '' end - format_head_toc=SiSU_HTML_Format::Head_toc.new(@md) - @links_guide_toc << format_head_toc.links_guide_close #(guide_type) - @links_guide_toc end end class Endnotes diff --git a/lib/sisu/v2/html_format.rb b/lib/sisu/v2/html_format.rb index 358fa293..c4758c5f 100644 --- a/lib/sisu/v2/html_format.rb +++ b/lib/sisu/v2/html_format.rb @@ -418,7 +418,7 @@ WOK #{@vz.table_close}} end end - def links_guide_vertical_open #??? + def links_guide_vertical_open url=((defined? @vz.url_hp) && @vz.url_hp =~/^https?:\/\/\S+$/ ? @vz.url_hp : @vz.url_home) %{