aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorRalph Amissah <ralph@amissah.com>2010-07-06 16:17:04 -0400
committerRalph Amissah <ralph@amissah.com>2010-07-06 16:17:04 -0400
commit1866f5d2bfc189c5f53d6e0c350b727a455c75b5 (patch)
tree1c3b3d59bffe5fda6c843be733751826e19de841 /lib
parentdb_import, remove monospace tag (diff)
shared_html_lite, db_import, monospace font (codeblock & monospace tag)
Diffstat (limited to 'lib')
-rw-r--r--lib/sisu/v2/db_import.rb2
-rw-r--r--lib/sisu/v2/shared_html_lite.rb6
2 files changed, 8 insertions, 0 deletions
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]}/,'<sup>\1</sup>')
s=s.gsub(/#{Mx[:fa_subscript_o]}(.+?)#{Mx[:fa_subscript_c]}/,'<sub>\1</sub>')
+ s=s.gsub(/#{Mx[:fa_monospace_o]}(.+?)#{Mx[:fa_monospace_c]}/,'<tt>\1</tt>') # 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 =>"<tt>#{txt}</tt>",: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}