From a151893efedaebc26d26a8f8611fb688a6de6d4f Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Wed, 5 Feb 2014 00:56:10 -0500 Subject: v5 v6: ocn: strict html; turn on/off rules for txt & odf --- lib/sisu/v6/html_format.rb | 25 ++++++++++++++++--------- 1 file changed, 16 insertions(+), 9 deletions(-) (limited to 'lib/sisu/v6/html_format.rb') diff --git a/lib/sisu/v6/html_format.rb b/lib/sisu/v6/html_format.rb index 18d42e14..ddfaaa70 100644 --- a/lib/sisu/v6/html_format.rb +++ b/lib/sisu/v6/html_format.rb @@ -66,30 +66,36 @@ module SiSU_HTML_Format def initialize(md,ocn) @md,@ocn=md,ocn.to_s @ocn ||='' + @ocn_html_identifier=SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier + @make=SiSU_Env::ProcessingSettings.new(@md) end def ocn_display - make=SiSU_Env::ProcessingSettings.new(@md) - if make.build.ocn? - ocn_class='ocn' + if @make.build.ocn? if @ocn.to_i==0 \ or @ocn.empty? - %{} + '' else + name=(@make.build.html_strict?) ? '' : %{ name="#{@ocn}"} @ocn.gsub(/^(\d+|)$/, - %{}) + %{}) end else - %{} + '' end end def name - (@ocn==nil || @ocn.empty?) ? '' : %{} + if @make.build.html_strict? \ + or @ocn==(nil || @ocn.empty?) + '' + else + %{} + end end def id #w3c? "tidy" complains about numbers as identifiers ! annoying (@ocn==nil || @ocn.empty?) ? '' : %{id="o#{@ocn}"} end def goto - (@ocn==nil || @ocn.empty?) ? '' : %{} + (@ocn==nil || @ocn.empty?) ? '' : %{} end end class HeadInformation @@ -1233,6 +1239,7 @@ WOK end def subtoc_lev(tag,attrib) @txt=clean(@txt) + @ocn_html_identifier=SiSU_Env::ProcessingSettings.new(@md).ocn_html_identifier txt=if @txt \ and @txt =~/<\/?i>|/mi @txt.gsub(/<\/?i>|/mi,'') #removes name markers from subtoc, go directly to substantive text @@ -1246,7 +1253,7 @@ WOK gsub(/ \d+<\/sup> /m,'') end %{<#{tag} class="#{attrib}"> - #{txt} #{note} + #{txt} #{note} } end def subtoc_lev5 -- cgit v1.2.3