From 1866f5d2bfc189c5f53d6e0c350b727a455c75b5 Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Tue, 6 Jul 2010 16:17:04 -0400 Subject: shared_html_lite, db_import, monospace font (codeblock & monospace tag) --- lib/sisu/v2/db_import.rb | 2 ++ lib/sisu/v2/shared_html_lite.rb | 6 ++++++ 2 files changed, 8 insertions(+) (limited to 'lib') diff --git a/lib/sisu/v2/db_import.rb b/lib/sisu/v2/db_import.rb index bdb3fcac..4237757f 100644 --- a/lib/sisu/v2/db_import.rb +++ b/lib/sisu/v2/db_import.rb @@ -385,6 +385,8 @@ module SiSU_DB_import @en_a_plus,@en_z_plus=@en_pls[0].first,@en_pls[0].last if @en_pls[0] @col[:body]=if data.is=='table' SiSU_Format_Shared::CSS_Format.new(@md,data).html_table + elsif data.is=='code' + SiSU_Format_Shared::CSS_Format.new(@md,data).code elsif defined? data.indent and data.indent =~/[1-9]/ SiSU_Format_Shared::CSS_Format.new(@md,data).indent(data.indent) else diff --git a/lib/sisu/v2/shared_html_lite.rb b/lib/sisu/v2/shared_html_lite.rb index bb27258c..02b4dcc2 100644 --- a/lib/sisu/v2/shared_html_lite.rb +++ b/lib/sisu/v2/shared_html_lite.rb @@ -147,6 +147,7 @@ module SiSU_Format_Shared s=s.gsub(/#{Mx[:fa_strike_o]}(.+?)#{Mx[:fa_strke_c]}/,'-{\1}-') s=s.gsub(/#{Mx[:fa_superscript_o]}(.+?)#{Mx[:fa_superscript_c]}/,'\1') s=s.gsub(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,'\1') + s=s.gsub(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'\1') # tt, kbd s=s.gsub(/#{Mx[:gl_o]}#(?:126|152)#{Mx[:gl_c]}/i,'~') end def markup_object(t_o) @@ -225,6 +226,11 @@ GSUB h={:txt =>txt,:class =>'norm',:type =>'substantive',:id =>@ocn} tag_para(h) end + def code + txt=markup_object(@t_o) + h={:txt =>"#{txt}",:class =>'code',:type =>'substantive',:id =>@ocn} + tag_para(h) + end def indent(t) txt=markup_object(@t_o) h={:txt =>txt,:class =>"indent#{t}",:type =>'substantive',:id =>@ocn} -- cgit v1.2.3