diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-09-05 22:54:22 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-09-05 23:14:30 -0400 |
commit | 6a13e63f51e69dacefe580b9084006ae66d3fafc (patch) | |
tree | 59862efda52be828b6559910b2e80e0aa7f7dc06 /lib/sisu/v5/xml_format.rb | |
parent | v5 v6: shared_metadata, requires xml_shared (diff) |
v5 v6: xml xhtml outputs, & issues
Diffstat (limited to 'lib/sisu/v5/xml_format.rb')
-rw-r--r-- | lib/sisu/v5/xml_format.rb | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/sisu/v5/xml_format.rb b/lib/sisu/v5/xml_format.rb index fb2cff88..4a7264c0 100644 --- a/lib/sisu/v5/xml_format.rb +++ b/lib/sisu/v5/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=%{<meta name="dc.rights" content="#{@md.rights.all}" />\n} + rights=meta_content_clean(@md.rights.all) + copyright=meta_content_clean(@md.rights.copyright.all) + @rdf_rights=%{ dc.rights="#{rights}"\n} + @rights=%{<meta name="dc.rights" content="#{rights}" />\n} end - @copyright=%{<meta name="copyright" content="#{@md.rights.copyright.all}" />\n} if @md.rights.copyright.all # possibly redundant see dc.rights + @copyright=%{<meta name="copyright" content="#{copyright}" />\n} \ + if @md.rights.copyright.all # possibly redundant see dc.rights @owner=%{<meta name="owner" content="#{@md.owner}" />\n} if @md.owner @keywords=%{<meta name="keywords" content="#{@md.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 '</font> </td></tr></table>' end @@ -558,7 +569,8 @@ WOK def prefix_a end def rights - rights=@md.rights.copyright.all.gsub(/^\s*Copyright\s+\(C\)/,'Copyright <sup>©</sup> ') + copyright=meta_content_clean(@md.rights.copyright.all) + rights=copyright(/^\s*Copyright\s+\(C\)/,'Copyright <sup>©</sup> ') %{<p class="small_left">Rights: #{rights}</p> <p />} end |