From 6a13e63f51e69dacefe580b9084006ae66d3fafc Mon Sep 17 00:00:00 2001 From: Ralph Amissah Date: Fri, 5 Sep 2014 22:54:22 -0400 Subject: v5 v6: xml xhtml outputs, & issues --- lib/sisu/v6/xml_format.rb | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) (limited to 'lib/sisu/v6/xml_format.rb') diff --git a/lib/sisu/v6/xml_format.rb b/lib/sisu/v6/xml_format.rb index 38cc7f85..e649fa51 100644 --- a/lib/sisu/v6/xml_format.rb +++ b/lib/sisu/v6/xml_format.rb @@ -191,15 +191,26 @@ module SiSU_XML_Format end if defined? @md.rights.all \ and @md.rights.all=~/\S+/ # DublinCore 15 - rights - @rdf_rights=%{ dc.rights="#{@md.rights.all}"\n} - @rights=%{\n} + rights=meta_content_clean(@md.rights.all) + copyright=meta_content_clean(@md.rights.copyright.all) + @rdf_rights=%{ dc.rights="#{rights}"\n} + @rights=%{\n} end - @copyright=%{\n} if @md.rights.copyright.all # possibly redundant see dc.rights + @copyright=%{\n} \ + if @md.rights.copyright.all # possibly redundant see dc.rights @owner=%{\n} if @md.owner @keywords=%{\n} if @md.keywords @vz=SiSU_Viz::Defaults.new #margin,paragraph,table,banner,url,png,txt,color,font,nav_txt,nav_png,credits,js,php @index='index' end + def meta_content_clean(content='') + content=if not content.nil? + content=content.tr('"',"'"). + gsub(/&/,'&') + content=SiSU_XML_Munge::Trans.new(@md).char_enc.utf8(content) + else content + end + end def table_close ' ' end @@ -558,7 +569,8 @@ WOK def prefix_a end def rights - rights=@md.rights.copyright.all.gsub(/^\s*Copyright\s+\(C\)/,'Copyright © ') + copyright=meta_content_clean(@md.rights.copyright.all) + rights=copyright(/^\s*Copyright\s+\(C\)/,'Copyright © ') %{

Rights: #{rights}

} end -- cgit v1.2.3