From 84957a4260170c3b81a690853ba5b865f59e1217 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Sun, 19 Oct 2014 21:05:55 -0400 Subject: v5 v6: html, remove trailing backslash for empty linebreak & paragraph,

--- data/doc/sisu/CHANGELOG_v5 | 2 + data/doc/sisu/CHANGELOG_v6 | 2 + lib/sisu/v5/ao_syntax.rb | 2 +- lib/sisu/v5/cgi_sql_common.rb | 110 +++++++++++++++++++++--------------------- lib/sisu/v5/db_sqltxt.rb | 10 ++-- lib/sisu/v5/html_segments.rb | 4 +- lib/sisu/v5/html_tune.rb | 2 +- lib/sisu/v6/ao_syntax.rb | 2 +- lib/sisu/v6/cgi_sql_common.rb | 110 +++++++++++++++++++++--------------------- lib/sisu/v6/db_sqltxt.rb | 10 ++-- lib/sisu/v6/html_segments.rb | 4 +- lib/sisu/v6/html_tune.rb | 2 +- 12 files changed, 132 insertions(+), 128 deletions(-) diff --git a/data/doc/sisu/CHANGELOG_v5 b/data/doc/sisu/CHANGELOG_v5 index 05f80cfd..56116bf1 100644 --- a/data/doc/sisu/CHANGELOG_v5 +++ b/data/doc/sisu/CHANGELOG_v5 @@ -38,6 +38,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_5.7.1.orig.tar.xz sisu_5.7.1.orig.tar.xz sisu_5.7.1-1.dsc +* html, remove trailing backslash for empty linebreak & paragraph,

+ %% 5.7.0.orig.tar.xz (2014-10-12:40/7) http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_5.7.0 http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_5.7.0-1 diff --git a/data/doc/sisu/CHANGELOG_v6 b/data/doc/sisu/CHANGELOG_v6 index 8b854a8d..7d4f6580 100644 --- a/data/doc/sisu/CHANGELOG_v6 +++ b/data/doc/sisu/CHANGELOG_v6 @@ -28,6 +28,8 @@ http://www.jus.uio.no/sisu/pkg/src/sisu_6.3.1.orig.tar.xz sisu_6.3.1.orig.tar.xz sisu_6.3.1-1.dsc +* html, remove trailing backslash for empty linebreak & paragraph,

+ %% 6.3.0.orig.tar.xz (2014-10-12:40/7) http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/sisu_6.3.0 http://git.sisudoc.org/gitweb/?p=code/sisu.git;a=log;h=refs/tags/debian/sisu_6.3.0-1 diff --git a/lib/sisu/v5/ao_syntax.rb b/lib/sisu/v5/ao_syntax.rb index be184a5e..f5608d97 100644 --- a/lib/sisu/v5/ao_syntax.rb +++ b/lib/sisu/v5/ao_syntax.rb @@ -518,7 +518,7 @@ module SiSU_AO_Syntax elsif dob.is ==:code dob.obj=dob.obj. gsub(/#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}\s*/,'@\1: '). - gsub(/(^|#{Mx[:gl_c]}|\s)<(br(?: \/)?)>([\s,.]|$)/,'\1<\2>\3') #convert

back, clumsy + gsub(/(^|#{Mx[:gl_c]}|\s)<(?:br(?: \/)?)>([\s,.]|$)/,'\1
\2') #convert

back, clumsy if dob.number_ codeline=[] ln=1 diff --git a/lib/sisu/v5/cgi_sql_common.rb b/lib/sisu/v5/cgi_sql_common.rb index d6f99342..eb8ce0ab 100644 --- a/lib/sisu/v5/cgi_sql_common.rb +++ b/lib/sisu/v5/cgi_sql_common.rb @@ -134,7 +134,7 @@ module SiSU_CGI_SQL search_field='' if checked_echo !~/\S/ @base,@search_field,@selected_db,@result_type,@checked_sql_limit,@checked_tip,@checked_stats,@checked_searched,@checked_url,@checked_case,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_selected,@checked_default,@search_note,@the_can=base,search_field,selected_db,result_type,checked_sql_limit,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can @tip=if checked_tip =~/\S/ - 'text:__; fulltxt:__; keywords:__; title:__; author:__; topic_register:__; subject:__; description:__; publisher:__; editor:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;
' + 'text:__; fulltxt:__; keywords:__; title:__; author:__; topic_register:__; subject:__; description:__; publisher:__; editor:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;
' else '' end end @@ -161,10 +161,10 @@ module SiSU_CGI_SQL @@ -193,7 +193,7 @@ module SiSU_CGI_SQL to search: select which database to search (drop-down menu below); enter your search query (in the form above); and click on the search button (below) -
+
1,000 2,500 -
+
echo query result stats search url searched available fields sql statement -
+
checks: default selected @@ -483,14 +483,14 @@ module SiSU_CGI_SQL page=(sql_offset.to_i + sql_match_limit.to_i)/sql_match_limit.to_i if beyond_limit if page.to_s =~ /^1$/ - %{
+ %{
pg. #{page.to_s}  >>
} elsif page.to_s =~ /^2$/ - %{
+ %{
<<  @@ -500,7 +500,7 @@ module SiSU_CGI_SQL
} else - %{
+ %{
|<  @@ -516,14 +516,14 @@ module SiSU_CGI_SQL else if page.to_s =~ /^1$/ then '' elsif page.to_s =~ /^2$/ - %{
+ %{
<<  pg. #{page.to_s}
} else - %{
+ %{
|<  @@ -542,16 +542,16 @@ module SiSU_CGI_SQL <<-WOK_SQL def tail <<-'WOK' -


+


-
+
SiSU -
+
git
@@ -562,14 +562,14 @@ module SiSU_CGI_SQL

Generated by #{v[:project]} #{v[:version]} #{v[:date]} (#{v[:date_stamp]}) -
+
#{v[:project]} © Ralph Amissah 1993, current 2014. All Rights Reserved. -
+
#{v[:project]} is software for document structuring, publishing and search, -
+
www.jus.uio.no/sisu @@ -581,17 +581,17 @@ module SiSU_CGI_SQL git.sisudoc.org -
+
w3 since October 3 1993 ralph@amissah.com -
+
mailing list subscription http://lists.sisudoc.org/listinfo/sisu -
+
sisu@lists.sisudoc.org @@ -599,10 +599,10 @@ module SiSU_CGI_SQL

-
+
SiSU -
+
git

#{v[:project]} using: -
Standard SiSU markup syntax, -
Standard SiSU meta-markup syntax, and the -
Standard SiSU object citation numbering and system, (object/text identifying/locating system) -
+
Standard SiSU markup syntax, +
Standard SiSU meta-markup syntax, and the +
Standard SiSU object citation numbering and system, (object/text identifying/locating system) +
© Ralph Amissah 1997, current 2014. All Rights Reserved.

@@ -767,39 +767,39 @@ module SiSU_CGI_SQL end green=%{} canned_search_url_txt=CGI.escapeHTML(@@canned_search_url) - the_can=%{#{canned_note} #{canned_search_url_txt}
} + the_can=%{#{canned_note} #{canned_search_url_txt}
} p_text=p_fulltext=p_keywords=p_title=p_author=p_topic_register=p_subject=p_description=p_publisher=p_editor=p_contributor=p_date=p_type=p_format=p_identifier=p_source=p_language=p_relation=p_coverage=p_rights=p_comment=p_abstract=p_filename='' - p_filename=%{filename: #{green}#{@search_for.filename}

} if @search_for.filename =~/\S+/ - p_text=%{text: #{green}#{@search_for.text1}
} if @search_for.text1 =~/\S+/ - p_fulltext=%{fulltxt: #{green}#{@search_for.fulltext}
} if @search_for.fulltext =~/\S+/ - p_title=%{title: #{green}#{@search_for.title}
} if @search_for.title =~/\S+/ - p_author=%{author: #{green}#{@search_for.author}
} if @search_for.author =~/\S+/ - p_editor=%{editor: #{green}#{@search_for.editor}
} if @search_for.editor=~/\S+/ - p_contributor=%{contributor: #{green}#{@search_for.contributor}
} if @search_for.contributor =~/\S+/ - p_date=%{date: #{green}#{@search_for.date}
} if @search_for.date =~/\S+/ - p_rights=%{rights: #{green}#{@search_for.rights}
} if @search_for.rights =~/\S+/ - p_topic_register=%{topic_register: #{green}#{@search_for.topic_register}
} if @search_for.topic_register =~/\S+/ - p_subject=%{subject: #{green}#{@search_for.subject}
} if @search_for.subject =~/\S+/ - p_keywords=%{keywords: #{green}#{@search_for.keywords}
} if @search_for.keywords =~/\S+/ - p_identifier=%{identifier: #{green}#{@search_for.identifier}
} if @search_for.identifier =~/\S+/ - p_type=%{type: #{green}#{@search_for.type}
} if @search_for.type =~/\S+/ - p_format=%{format: #{green}#{@search_for.format}
} if @search_for.format =~/\S+/ - p_relation=%{relation: #{green}#{@search_for.relation}
} if @search_for.relation =~/\S+/ - p_coverage=%{coverage: #{green}#{@search_for.coverage}
} if @search_for.coverage =~/\S+/ - p_description=%{description: #{green}#{@search_for.description}
} if @search_for.description =~/\S+/ - p_abstract=%{abstract: #{green}#{@search_for.abstract}
} if @search_for.abstract =~/\S+/ - p_comment=%{comment: #{green}#{@search_for.comment}
} if @search_for.comment =~/\S+/ - p_publisher=%{publisher: #{green}#{@search_for.publisher}
} if @search_for.publisher =~/\S+/ - p_source=%{source: #{green}#{@search_for.source}
} if @search_for.source =~/\S+/ - p_language=%{language: #{green}#{@search_for.language}
} if @search_for.language =~/\S+/ + p_filename=%{filename: #{green}#{@search_for.filename}
} if @search_for.filename =~/\S+/ + p_text=%{text: #{green}#{@search_for.text1}
} if @search_for.text1 =~/\S+/ + p_fulltext=%{fulltxt: #{green}#{@search_for.fulltext}
} if @search_for.fulltext =~/\S+/ + p_title=%{title: #{green}#{@search_for.title}
} if @search_for.title =~/\S+/ + p_author=%{author: #{green}#{@search_for.author}
} if @search_for.author =~/\S+/ + p_editor=%{editor: #{green}#{@search_for.editor}
} if @search_for.editor=~/\S+/ + p_contributor=%{contributor: #{green}#{@search_for.contributor}
} if @search_for.contributor =~/\S+/ + p_date=%{date: #{green}#{@search_for.date}
} if @search_for.date =~/\S+/ + p_rights=%{rights: #{green}#{@search_for.rights}
} if @search_for.rights =~/\S+/ + p_topic_register=%{topic_register: #{green}#{@search_for.topic_register}
} if @search_for.topic_register =~/\S+/ + p_subject=%{subject: #{green}#{@search_for.subject}
} if @search_for.subject =~/\S+/ + p_keywords=%{keywords: #{green}#{@search_for.keywords}
} if @search_for.keywords =~/\S+/ + p_identifier=%{identifier: #{green}#{@search_for.identifier}
} if @search_for.identifier =~/\S+/ + p_type=%{type: #{green}#{@search_for.type}
} if @search_for.type =~/\S+/ + p_format=%{format: #{green}#{@search_for.format}
} if @search_for.format =~/\S+/ + p_relation=%{relation: #{green}#{@search_for.relation}
} if @search_for.relation =~/\S+/ + p_coverage=%{coverage: #{green}#{@search_for.coverage}
} if @search_for.coverage =~/\S+/ + p_description=%{description: #{green}#{@search_for.description}
} if @search_for.description =~/\S+/ + p_abstract=%{abstract: #{green}#{@search_for.abstract}
} if @search_for.abstract =~/\S+/ + p_comment=%{comment: #{green}#{@search_for.comment}
} if @search_for.comment =~/\S+/ + p_publisher=%{publisher: #{green}#{@search_for.publisher}
} if @search_for.publisher =~/\S+/ + p_source=%{source: #{green}#{@search_for.source}
} if @search_for.source =~/\S+/ + p_language=%{language: #{green}#{@search_for.language}
} if @search_for.language =~/\S+/ search_note=<<-WOK database: #{green}#{@db}; selected view: #{green}#{cgi['view']} - search string: "#{green}#{analyze_format}"
+ search string: "#{green}#{analyze_format}"
#{p_text} #{p_fulltext} #{p_keywords} #{p_title} #{p_author} #{p_topic_register} #{p_subject} #{p_description} #{p_publisher} #{p_editor} #{p_contributor} #{p_date} #{p_type} #{p_format} #{p_identifier} #{p_source} #{p_language} #{p_relation} #{p_coverage} #{p_rights} #{p_comment} #{p_abstract} #{p_filename} WOK - #eg = %{canned search e.g.:
#{url}
find: #{analyze}
database: #{database}} + #eg = %{canned search e.g.:
#{url}
find: #{analyze}
database: #{database}} #% dbi_canning @header=Form.new(@base,search_field,selected_db,result_type,checked_sql_limit,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can).submission_form #% form unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/ @@ -928,10 +928,10 @@ module SiSU_CGI_SQL can_txt_srch=(cgi['view']=~/index/) \ ? %{search } : %{search } - title=%{toc html #{ti} [#{c['language_document_char']}] by #{c['creator_author']} manifest #{can_txt_srch}
} if file_suffix=~/s/ #hmm watch file_suffix + title=%{toc html #{ti} [#{c['language_document_char']}] by #{c['creator_author']} manifest #{can_txt_srch}
} if file_suffix=~/s/ #hmm watch file_suffix title=@text_search_flag \ - ? '

'+title - : '
'+title + ? '

'+title + : '
'+title @counter_txt_doc+=1 oldtid=c['tid'].to_i else title='' @@ -996,7 +996,7 @@ module SiSU_CGI_SQL @@lt_t=(@counter_txt_ocn==dbi_statement.sql_match_limit.to_i) ? true : false start=(@@offset.to_i+1).to_s range=(@@offset.to_i+@counter_txt_ocn.to_i).to_s - %{
Found #{@counter_txt_ocn} times in the main body of #{@counter_txt_doc} documents [ matches #{start} to #{range} ]
} + %{
Found #{@counter_txt_ocn} times in the main body of #{@counter_txt_doc} documents [ matches #{start} to #{range} ]
} else '' end else '' diff --git a/lib/sisu/v5/db_sqltxt.rb b/lib/sisu/v5/db_sqltxt.rb index ffb5966b..6585fd66 100644 --- a/lib/sisu/v5/db_sqltxt.rb +++ b/lib/sisu/v5/db_sqltxt.rb @@ -62,11 +62,11 @@ module SiSU_DbText def special_character_escape(str) str=str.gsub(/'/,"''"). #string.gsub!(/'/,"\047") #string.gsub!(/'/,"\\'") gsub(/(\\)/m,'\1\1'). #ok but with warnings, double backslash on sqlite #str.gsub!(/[\\]/m,'\\x5C') #ok but with warnings, but not for sqlite #str.gsub!(/(\\)/m,'\1') #ok for sqlite not for pgsql - gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}/,"
\n"). - gsub(/#{Mx[:tag_o]}\S+?#{Mx[:tag_c]}/,''). #check - gsub(/#{Mx[:lnk_o]}\s*(\S+?\.(?:png|jpg))(?:\s+\d+x\d+)?(.+?)#{Mx[:lnk_c]}\S+/,'[image: \1] \2'). - gsub(/#{Mx[:lnk_o]}\s*(.+?)\s*#{Mx[:lnk_c]}(?:file|ftp):\/\/\S+?([.,!?]?(?:\s|$))/,'\1\2'). - gsub(/#{Mx[:lnk_o]}\s*(.+?)\s*#{Mx[:lnk_c]}#{Mx[:url_o]}\S+?#{Mx[:url_c]}/,'\1') + gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}/m,"
\n"). + gsub(/#{Mx[:tag_o]}\S+?#{Mx[:tag_c]}/m,''). #check + gsub(/#{Mx[:lnk_o]}\s*(\S+?\.(?:png|jpg))(?:\s+\d+x\d+)?(.+?)#{Mx[:lnk_c]}\S+/m,'[image: \1] \2'). + gsub(/#{Mx[:lnk_o]}\s*(.+?)\s*#{Mx[:lnk_c]}(?:file|ftp):\/\/\S+?([.,!?]?(?:\s|$))/m,'\1\2'). + gsub(/#{Mx[:lnk_o]}\s*(.+?)\s*#{Mx[:lnk_c]}#{Mx[:url_o]}\S+?#{Mx[:url_c]}/m,'\1') end def clean_searchable_text_from_document_objects(arr) txt_arr,en=[],[] diff --git a/lib/sisu/v5/html_segments.rb b/lib/sisu/v5/html_segments.rb index 60cd51f1..4c588bb9 100644 --- a/lib/sisu/v5/html_segments.rb +++ b/lib/sisu/v5/html_segments.rb @@ -689,7 +689,7 @@ module SiSU_HTML_Seg note_match=note.dup note_match_seg=note.dup e_n=note_match_seg[/(?:#{Mx[:en_a_o]}[\d*+]+|#{Mx[:en_b_o]}[*+]\d+)\s+(.+?)(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/m,1] - try=e_n.split(/
/) + try=e_n.split(//) try.each do |e| txt_obj={ txt: e } format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) @@ -699,7 +699,7 @@ module SiSU_HTML_Seg end @@seg_endnotes_array << note_match end - try.join('
') + try.join('
') #% creation of separate end segment/page of all endnotes referenced back to reference segment m=/(?:#{Mx[:en_a_o]}[\d*+]+|#{Mx[:en_b_o]}[*+]\d+)\s+(.+?href=")(##{Mx[:note_ref]}[\d*+]+".+)(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/mi endnote_part_a=note_match_seg[m,1] diff --git a/lib/sisu/v5/html_tune.rb b/lib/sisu/v5/html_tune.rb index 7cd2a920..526faa82 100644 --- a/lib/sisu/v5/html_tune.rb +++ b/lib/sisu/v5/html_tune.rb @@ -290,7 +290,7 @@ module SiSU_HTML_Tune gsub(/#{Mx[:mk_o]}:name#(\S+?)#{Mx[:mk_c]}/,''). gsub(/#{Mx[:gl_bullet]}/m,'●  '). gsub(/#{Mx[:nbsp]}/,' '). - gsub(/<(p|br)>/,'<\1 />') + gsub(/<(p|br) \/>/,'<\1>') dob=SiSU_HTML_Tune::CleanHTML.new(dob).clean dob end diff --git a/lib/sisu/v6/ao_syntax.rb b/lib/sisu/v6/ao_syntax.rb index 2e771185..da1daddf 100644 --- a/lib/sisu/v6/ao_syntax.rb +++ b/lib/sisu/v6/ao_syntax.rb @@ -518,7 +518,7 @@ module SiSU_AO_Syntax elsif dob.is ==:code dob.obj=dob.obj. gsub(/#{Mx[:meta_o]}(\S+?)#{Mx[:meta_c]}\s*/,'@\1: '). - gsub(/(^|#{Mx[:gl_c]}|\s)<(br(?: \/)?)>([\s,.]|$)/,'\1<\2>\3') #convert

back, clumsy + gsub(/(^|#{Mx[:gl_c]}|\s)<(?:br(?: \/)?)>([\s,.]|$)/,'\1
\2') #convert

back, clumsy if dob.number_ codeline=[] ln=1 diff --git a/lib/sisu/v6/cgi_sql_common.rb b/lib/sisu/v6/cgi_sql_common.rb index a05f8f53..0bc663d0 100644 --- a/lib/sisu/v6/cgi_sql_common.rb +++ b/lib/sisu/v6/cgi_sql_common.rb @@ -134,7 +134,7 @@ module SiSU_CGI_SQL search_field='' if checked_echo !~/\S/ @base,@search_field,@selected_db,@result_type,@checked_sql_limit,@checked_tip,@checked_stats,@checked_searched,@checked_url,@checked_case,@checked_echo,@checked_sql,@checked_all,@checked_none,@checked_selected,@checked_default,@search_note,@the_can=base,search_field,selected_db,result_type,checked_sql_limit,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can @tip=if checked_tip =~/\S/ - 'text:__; fulltxt:__; keywords:__; title:__; author:__; topic_register:__; subject:__; description:__; publisher:__; editor:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;
' + 'text:__; fulltxt:__; keywords:__; title:__; author:__; topic_register:__; subject:__; description:__; publisher:__; editor:__; contributor:__; date:__; type:__; format:__; identifier:__; source:__; language:__; relation:__; coverage:__; rights:__; comment:__; abstract:__; filename:__;
' else '' end end @@ -161,10 +161,10 @@ module SiSU_CGI_SQL
@@ -193,7 +193,7 @@ module SiSU_CGI_SQL to search: select which database to search (drop-down menu below); enter your search query (in the form above); and click on the search button (below) -
+
1,000 2,500 -
+
echo query result stats search url searched available fields sql statement -
+
checks: default selected @@ -483,14 +483,14 @@ module SiSU_CGI_SQL page=(sql_offset.to_i + sql_match_limit.to_i)/sql_match_limit.to_i if beyond_limit if page.to_s =~ /^1$/ - %{
+ %{
pg. #{page.to_s}  >>
} elsif page.to_s =~ /^2$/ - %{
+ %{
<<  @@ -500,7 +500,7 @@ module SiSU_CGI_SQL
} else - %{
+ %{
|<  @@ -516,14 +516,14 @@ module SiSU_CGI_SQL else if page.to_s =~ /^1$/ then '' elsif page.to_s =~ /^2$/ - %{
+ %{
<<  pg. #{page.to_s}
} else - %{
+ %{
|<  @@ -542,16 +542,16 @@ module SiSU_CGI_SQL <<-WOK_SQL def tail <<-'WOK' -


+


-
+
SiSU -
+
git
@@ -562,14 +562,14 @@ module SiSU_CGI_SQL

Generated by #{v[:project]} #{v[:version]} #{v[:date]} (#{v[:date_stamp]}) -
+
#{v[:project]} © Ralph Amissah 1993, current 2014. All Rights Reserved. -
+
#{v[:project]} is software for document structuring, publishing and search, -
+
www.jus.uio.no/sisu @@ -581,17 +581,17 @@ module SiSU_CGI_SQL git.sisudoc.org -
+
w3 since October 3 1993 ralph@amissah.com -
+
mailing list subscription http://lists.sisudoc.org/listinfo/sisu -
+
sisu@lists.sisudoc.org @@ -599,10 +599,10 @@ module SiSU_CGI_SQL

-
+
SiSU -
+
git

#{v[:project]} using: -
Standard SiSU markup syntax, -
Standard SiSU meta-markup syntax, and the -
Standard SiSU object citation numbering and system, (object/text identifying/locating system) -
+
Standard SiSU markup syntax, +
Standard SiSU meta-markup syntax, and the +
Standard SiSU object citation numbering and system, (object/text identifying/locating system) +
© Ralph Amissah 1997, current 2014. All Rights Reserved.

@@ -767,39 +767,39 @@ module SiSU_CGI_SQL end green=%{} canned_search_url_txt=CGI.escapeHTML(@@canned_search_url) - the_can=%{#{canned_note} #{canned_search_url_txt}
} + the_can=%{#{canned_note} #{canned_search_url_txt}
} p_text=p_fulltext=p_keywords=p_title=p_author=p_topic_register=p_subject=p_description=p_publisher=p_editor=p_contributor=p_date=p_type=p_format=p_identifier=p_source=p_language=p_relation=p_coverage=p_rights=p_comment=p_abstract=p_filename='' - p_filename=%{filename: #{green}#{@search_for.filename}

} if @search_for.filename =~/\S+/ - p_text=%{text: #{green}#{@search_for.text1}
} if @search_for.text1 =~/\S+/ - p_fulltext=%{fulltxt: #{green}#{@search_for.fulltext}
} if @search_for.fulltext =~/\S+/ - p_title=%{title: #{green}#{@search_for.title}
} if @search_for.title =~/\S+/ - p_author=%{author: #{green}#{@search_for.author}
} if @search_for.author =~/\S+/ - p_editor=%{editor: #{green}#{@search_for.editor}
} if @search_for.editor=~/\S+/ - p_contributor=%{contributor: #{green}#{@search_for.contributor}
} if @search_for.contributor =~/\S+/ - p_date=%{date: #{green}#{@search_for.date}
} if @search_for.date =~/\S+/ - p_rights=%{rights: #{green}#{@search_for.rights}
} if @search_for.rights =~/\S+/ - p_topic_register=%{topic_register: #{green}#{@search_for.topic_register}
} if @search_for.topic_register =~/\S+/ - p_subject=%{subject: #{green}#{@search_for.subject}
} if @search_for.subject =~/\S+/ - p_keywords=%{keywords: #{green}#{@search_for.keywords}
} if @search_for.keywords =~/\S+/ - p_identifier=%{identifier: #{green}#{@search_for.identifier}
} if @search_for.identifier =~/\S+/ - p_type=%{type: #{green}#{@search_for.type}
} if @search_for.type =~/\S+/ - p_format=%{format: #{green}#{@search_for.format}
} if @search_for.format =~/\S+/ - p_relation=%{relation: #{green}#{@search_for.relation}
} if @search_for.relation =~/\S+/ - p_coverage=%{coverage: #{green}#{@search_for.coverage}
} if @search_for.coverage =~/\S+/ - p_description=%{description: #{green}#{@search_for.description}
} if @search_for.description =~/\S+/ - p_abstract=%{abstract: #{green}#{@search_for.abstract}
} if @search_for.abstract =~/\S+/ - p_comment=%{comment: #{green}#{@search_for.comment}
} if @search_for.comment =~/\S+/ - p_publisher=%{publisher: #{green}#{@search_for.publisher}
} if @search_for.publisher =~/\S+/ - p_source=%{source: #{green}#{@search_for.source}
} if @search_for.source =~/\S+/ - p_language=%{language: #{green}#{@search_for.language}
} if @search_for.language =~/\S+/ + p_filename=%{filename: #{green}#{@search_for.filename}
} if @search_for.filename =~/\S+/ + p_text=%{text: #{green}#{@search_for.text1}
} if @search_for.text1 =~/\S+/ + p_fulltext=%{fulltxt: #{green}#{@search_for.fulltext}
} if @search_for.fulltext =~/\S+/ + p_title=%{title: #{green}#{@search_for.title}
} if @search_for.title =~/\S+/ + p_author=%{author: #{green}#{@search_for.author}
} if @search_for.author =~/\S+/ + p_editor=%{editor: #{green}#{@search_for.editor}
} if @search_for.editor=~/\S+/ + p_contributor=%{contributor: #{green}#{@search_for.contributor}
} if @search_for.contributor =~/\S+/ + p_date=%{date: #{green}#{@search_for.date}
} if @search_for.date =~/\S+/ + p_rights=%{rights: #{green}#{@search_for.rights}
} if @search_for.rights =~/\S+/ + p_topic_register=%{topic_register: #{green}#{@search_for.topic_register}
} if @search_for.topic_register =~/\S+/ + p_subject=%{subject: #{green}#{@search_for.subject}
} if @search_for.subject =~/\S+/ + p_keywords=%{keywords: #{green}#{@search_for.keywords}
} if @search_for.keywords =~/\S+/ + p_identifier=%{identifier: #{green}#{@search_for.identifier}
} if @search_for.identifier =~/\S+/ + p_type=%{type: #{green}#{@search_for.type}
} if @search_for.type =~/\S+/ + p_format=%{format: #{green}#{@search_for.format}
} if @search_for.format =~/\S+/ + p_relation=%{relation: #{green}#{@search_for.relation}
} if @search_for.relation =~/\S+/ + p_coverage=%{coverage: #{green}#{@search_for.coverage}
} if @search_for.coverage =~/\S+/ + p_description=%{description: #{green}#{@search_for.description}
} if @search_for.description =~/\S+/ + p_abstract=%{abstract: #{green}#{@search_for.abstract}
} if @search_for.abstract =~/\S+/ + p_comment=%{comment: #{green}#{@search_for.comment}
} if @search_for.comment =~/\S+/ + p_publisher=%{publisher: #{green}#{@search_for.publisher}
} if @search_for.publisher =~/\S+/ + p_source=%{source: #{green}#{@search_for.source}
} if @search_for.source =~/\S+/ + p_language=%{language: #{green}#{@search_for.language}
} if @search_for.language =~/\S+/ search_note=<<-WOK database: #{green}#{@db}; selected view: #{green}#{cgi['view']} - search string: "#{green}#{analyze_format}"
+ search string: "#{green}#{analyze_format}"
#{p_text} #{p_fulltext} #{p_keywords} #{p_title} #{p_author} #{p_topic_register} #{p_subject} #{p_description} #{p_publisher} #{p_editor} #{p_contributor} #{p_date} #{p_type} #{p_format} #{p_identifier} #{p_source} #{p_language} #{p_relation} #{p_coverage} #{p_rights} #{p_comment} #{p_abstract} #{p_filename} WOK - #eg = %{canned search e.g.:
#{url}
find: #{analyze}
database: #{database}} + #eg = %{canned search e.g.:
#{url}
find: #{analyze}
database: #{database}} #% dbi_canning @header=Form.new(@base,search_field,selected_db,result_type,checked_sql_limit,checked_tip,checked_stats,checked_searched,checked_url,checked_case,checked_echo,checked_sql,checked_all,checked_none,checked_selected,checked_default,search_note,the_can).submission_form #% form unless q['s1'] =~/\S/ or q['au'] =~/\S/ or @search[:text][1] =~/\S/ @@ -928,10 +928,10 @@ module SiSU_CGI_SQL can_txt_srch=(cgi['view']=~/index/) \ ? %{search } : %{search } - title=%{toc html #{ti} [#{c['language_document_char']}] by #{c['creator_author']} manifest #{can_txt_srch}
} if file_suffix=~/s/ #hmm watch file_suffix + title=%{toc html #{ti} [#{c['language_document_char']}] by #{c['creator_author']} manifest #{can_txt_srch}
} if file_suffix=~/s/ #hmm watch file_suffix title=@text_search_flag \ - ? '

'+title - : '
'+title + ? '

'+title + : '
'+title @counter_txt_doc+=1 oldtid=c['tid'].to_i else title='' @@ -996,7 +996,7 @@ module SiSU_CGI_SQL @@lt_t=(@counter_txt_ocn==dbi_statement.sql_match_limit.to_i) ? true : false start=(@@offset.to_i+1).to_s range=(@@offset.to_i+@counter_txt_ocn.to_i).to_s - %{
Found #{@counter_txt_ocn} times in the main body of #{@counter_txt_doc} documents [ matches #{start} to #{range} ]
} + %{
Found #{@counter_txt_ocn} times in the main body of #{@counter_txt_doc} documents [ matches #{start} to #{range} ]
} else '' end else '' diff --git a/lib/sisu/v6/db_sqltxt.rb b/lib/sisu/v6/db_sqltxt.rb index 7016c931..2fd39fb7 100644 --- a/lib/sisu/v6/db_sqltxt.rb +++ b/lib/sisu/v6/db_sqltxt.rb @@ -62,11 +62,11 @@ module SiSU_DbText def special_character_escape(str) str=str.gsub(/'/,"''"). #string.gsub!(/'/,"\047") #string.gsub!(/'/,"\\'") gsub(/(\\)/m,'\1\1'). #ok but with warnings, double backslash on sqlite #str.gsub!(/[\\]/m,'\\x5C') #ok but with warnings, but not for sqlite #str.gsub!(/(\\)/m,'\1') #ok for sqlite not for pgsql - gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}/,"
\n"). - gsub(/#{Mx[:tag_o]}\S+?#{Mx[:tag_c]}/,''). #check - gsub(/#{Mx[:lnk_o]}\s*(\S+?\.(?:png|jpg))(?:\s+\d+x\d+)?(.+?)#{Mx[:lnk_c]}\S+/,'[image: \1] \2'). - gsub(/#{Mx[:lnk_o]}\s*(.+?)\s*#{Mx[:lnk_c]}(?:file|ftp):\/\/\S+?([.,!?]?(?:\s|$))/,'\1\2'). - gsub(/#{Mx[:lnk_o]}\s*(.+?)\s*#{Mx[:lnk_c]}#{Mx[:url_o]}\S+?#{Mx[:url_c]}/,'\1') + gsub(/#{Mx[:br_line]}|#{Mx[:br_nl]}/m,"
\n"). + gsub(/#{Mx[:tag_o]}\S+?#{Mx[:tag_c]}/m,''). #check + gsub(/#{Mx[:lnk_o]}\s*(\S+?\.(?:png|jpg))(?:\s+\d+x\d+)?(.+?)#{Mx[:lnk_c]}\S+/m,'[image: \1] \2'). + gsub(/#{Mx[:lnk_o]}\s*(.+?)\s*#{Mx[:lnk_c]}(?:file|ftp):\/\/\S+?([.,!?]?(?:\s|$))/m,'\1\2'). + gsub(/#{Mx[:lnk_o]}\s*(.+?)\s*#{Mx[:lnk_c]}#{Mx[:url_o]}\S+?#{Mx[:url_c]}/m,'\1') end def clean_searchable_text_from_document_objects(arr) txt_arr,en=[],[] diff --git a/lib/sisu/v6/html_segments.rb b/lib/sisu/v6/html_segments.rb index 907e79a5..09c25359 100644 --- a/lib/sisu/v6/html_segments.rb +++ b/lib/sisu/v6/html_segments.rb @@ -689,7 +689,7 @@ module SiSU_HTML_Seg note_match=note.dup note_match_seg=note.dup e_n=note_match_seg[/(?:#{Mx[:en_a_o]}[\d*+]+|#{Mx[:en_b_o]}[*+]\d+)\s+(.+?)(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/m,1] - try=e_n.split(/
/) + try=e_n.split(//) try.each do |e| txt_obj={ txt: e } format_seg=SiSU_HTML_Format::FormatSeg.new(@md,txt_obj) @@ -699,7 +699,7 @@ module SiSU_HTML_Seg end @@seg_endnotes_array << note_match end - try.join('
') + try.join('
') #% creation of separate end segment/page of all endnotes referenced back to reference segment m=/(?:#{Mx[:en_a_o]}[\d*+]+|#{Mx[:en_b_o]}[*+]\d+)\s+(.+?href=")(##{Mx[:note_ref]}[\d*+]+".+)(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/mi endnote_part_a=note_match_seg[m,1] diff --git a/lib/sisu/v6/html_tune.rb b/lib/sisu/v6/html_tune.rb index 48bce66e..8ba389e6 100644 --- a/lib/sisu/v6/html_tune.rb +++ b/lib/sisu/v6/html_tune.rb @@ -290,7 +290,7 @@ module SiSU_HTML_Tune gsub(/#{Mx[:mk_o]}:name#(\S+?)#{Mx[:mk_c]}/,''). gsub(/#{Mx[:gl_bullet]}/m,'●  '). gsub(/#{Mx[:nbsp]}/,' '). - gsub(/<(p|br)>/,'<\1 />') + gsub(/<(p|br) \/>/,'<\1>') dob=SiSU_HTML_Tune::CleanHTML.new(dob).clean dob end -- cgit v1.2.3