aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v0/html_format.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v0/html_format.rb')
-rw-r--r--lib/sisu/v0/html_format.rb19
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/sisu/v0/html_format.rb b/lib/sisu/v0/html_format.rb
index 525ef50d..03d97a8d 100644
--- a/lib/sisu/v0/html_format.rb
+++ b/lib/sisu/v0/html_format.rb
@@ -960,7 +960,8 @@ WOK
end
def endnote_mark
%{<p class="center" id="endnotes">
-<a href="#top"><hr></a></p>} #revisit
+<a href="#top"><hr width=90% /></a>
+</p>} #revisit
end
end
class Format_text_object
@@ -969,10 +970,10 @@ WOK
attr_accessor :md,:one,:two,:three,:parablock,:table,:link,:linkname,:format,:paranum,:p_num,:para_id,:headname,:margin,:paragraph,:table,:banner,:url,:icon,:font,:one_stripped
def initialize(md='',*txt)
@md,@one,@two,@three=md,txt[0],txt[1],txt[2]
- rgx=/^[1-6-]~/
+ rgx=/^#{Mx[:lv_o]}\d:\S*?#{Mx[:lv_c]}/
@one_stripped=@one.gsub(rgx,'') if @one =~rgx
@dp=@@dp ||=SiSU_Env::Info_env.new.digest.pattern
- rgx=/~[{\[][\d*+]+\s+(.+?)<#@dp>[}\]]~/ #problem introduced
+ rgx=/(?:#{Mx[:en_a_o]}|#{Mx[:en_b_o]})[\d*+]+\s+(.+?)#{Mx[:id_o]}#@dp#{Mx[:id_c]}(?:#{Mx[:en_a_c]}|#{Mx[:en_b_c]})/ #problem introduced
@one_stripped=@one.gsub(rgx,'\1') if @one =~rgx #problem introduced
@link,@linkname=txt[0],txt[1]
@format,parablock=txt[0],txt[1]
@@ -989,7 +990,7 @@ WOK
@para_id=Paragraph_id_ocn.new(@md,@paranum) #used by table version
end
@headname=''
- if @format =~ /\d~(\S+)/
+ if @format=~/^\d:(\S+)/ #need more reliable marker #if @format =~ /#{Rx[:lv]}/
headname=$1 #format[/\d~(\S+)/m,1]
@headname=if headname =~/^[a-zA-Z]/; %{<a name="#{headname}" id="#{headname}"></a>} #consider: h_#{headname}
else %{<a name="h#{headname}" id="h#{headname}"></a>}
@@ -1045,12 +1046,12 @@ WOK
end
def gsub_body
case @one
- when /^(?:<:i[1-9]>\s*)?\((i+|iv|v|vi+|ix|x|xi+)\)/
+ when /^(?:#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]}\s*)?\((i+|iv|v|vi+|ix|x|xi+)\)/
@one.gsub!(/^\((i+|iv|v|vi+|ix|x|xi+)\)/,'<b>(\1)</b>')
- @one.gsub!(/^(<:i[1-9]>)\s*\((i+|iv|v|vi+|ix|x|xi+)\)/,'\1<b>(\2)</b>')
- when /^(?:<:i[1-9]>\s*)?\(?(\d|[a-z])+\)/
+ @one.gsub!(/^(#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]})\s*\((i+|iv|v|vi+|ix|x|xi+)\)/,'\1<b>(\2)</b>')
+ when /^(?:#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]}\s*)?\(?(\d|[a-z])+\)/
@one.gsub!(/^\((\d+|[a-z])+\)/,'<b>(\1)</b>')
- @one.gsub!(/^(<:i[1-9]>)\s*\((\d+|[a-z])+\)/,'\1<b>(\2)</b>')
+ @one.gsub!(/^(#{Mx[:pa_o]}i[1-9]#{Mx[:pa_c]})\s*\((\d+|[a-z])+\)/,'\1<b>(\2)</b>')
when /^\s*\d{1,3}\.\s/
@one.gsub!(/^\s*(\d+\.)/,'<b>\1</b>')
when /^\s*[A-Z]\.\s/
@@ -1069,7 +1070,7 @@ WOK
def bold_header
@one.gsub!(/[1-9]~(\S+)/,'<a name="\1"></a>')
@one.gsub!(/[1-9]~/,'')
- @one.gsub!(/<~0;[um]\d+;[um]\d+><#@dp:#@dp>\s*$/i,'') #watch & do differently
+ @one.gsub!(/#{Mx[:id_o]}~0;[um]\d+;[um]\d+#{Mx[:id_c]}#{Mx[:id_o]}#@dp:#@dp#{Mx[:id_c]}\s*$/i,'') #watch & do differently
%{<p class="bold">
#@one
</p>