diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-02-05 01:28:30 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-02-05 01:28:30 -0500 |
commit | ba017314c06829b8d8a92a85d2111a8582c4e1cc (patch) | |
tree | ae413a3c2eacce20422b238e0a57c16d5632adf8 /lib/sisu/v6/xhtml_epub2_format.rb | |
parent | debian/changelog (5.3.0-1) (diff) | |
parent | README & manpage (sisu.1) update (diff) |
Merge tag 'sisu_5.3.1' into debian/sid
SiSU 5.3.1
Diffstat (limited to 'lib/sisu/v6/xhtml_epub2_format.rb')
-rw-r--r-- | lib/sisu/v6/xhtml_epub2_format.rb | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/lib/sisu/v6/xhtml_epub2_format.rb b/lib/sisu/v6/xhtml_epub2_format.rb index d5b7e85e..626eb79f 100644 --- a/lib/sisu/v6/xhtml_epub2_format.rb +++ b/lib/sisu/v6/xhtml_epub2_format.rb @@ -1362,12 +1362,13 @@ output_epub_cont_seg.close depth=@md.lvs[1] + @md.lvs[2] + @md.lvs[3] + @md.lvs[4] title=SanitizeXML.xml(@md.title.full) author=SanitizeXML.xml(@md.author) + dgst=(@md.dgst.is_a?(Array) and @md.dgst.length > 1) ? @md.dgst[1] : 'na' <<-WOK <!-- four required metadata items (for all NCX documents, (including the relaxed constraints of OPS 2.0) --> <title>#{title} by #{author}</title> <link href="css/xhtml.css" rel="stylesheet" type="text/css" id="main-css" /> - <meta name="dtb:uid" content="urn:uuid:#{@md.dgst[1]}" /> + <meta name="dtb:uid" content="urn:uuid:#{dgst}" /> <!-- <meta name="epub-creator" content="#{@md.publisher}" /> --> <meta name="dtb:depth" content="#{depth}" /> <meta name="dtb:totalPageCount" content="0" /> @@ -1579,18 +1580,19 @@ output_epub_cont_seg.close else '' end f=SiSU_Env::FileOp.new(@md) + dgst=(@md.dgst.is_a?(Array) and @md.dgst.length > 1) ? @md.dgst[1] : 'na' <<-WOK <#{$ep[:o]}metadata xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:opf="http://www.idpf.org/2007/opf" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:dc="http://purl.org/dc/elements/1.1/" - unique-identifier="urn:uuid:#{@md.dgst[1]}" version="2.0"> + unique-identifier="urn:uuid:#{dgst}" version="2.0"> <dc:title>#{@md.title.full}</dc:title> #{cover_image}#{author}#{editor}#{translator}#{illustrator}#{language}#{date_published}#{subject}#{rights} <dc:identifier opf:scheme="URI">#{f.output_path.epub.url.gsub(/http:\/\//,'')}/#{f.base_filename.epub}</dc:identifier> - <dc:identifier id="bookid">urn:uuid:#{@md.dgst[1]}</dc:identifier> - <!-- <dc:identifier id="EPB-UUID">urn:uuid:#{@md.dgst[1]}</dc:identifier> --> + <dc:identifier id="bookid">urn:uuid:#{dgst}</dc:identifier> + <!-- <dc:identifier id="EPB-UUID">urn:uuid:#{dgst}</dc:identifier> --> </#{$ep[:o]}metadata> WOK end @@ -2132,10 +2134,10 @@ output_epub_cont_seg.close note='' if txt =~/(#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})/m # had \s* at end note=$1 - note=note.gsub(/[\n\s]+/m,' ') + note=note.gsub(/[\s]+/m,' ') txt=txt.gsub(/(?:#{Mx[:en_a_o]}.+?#{Mx[:en_a_c]}|#{Mx[:en_b_o]}.+?#{Mx[:en_b_c]})\s*/m,' '). - gsub(/<a[\n\s]+"[\n\s]+href="#note_ref\d+">#{$ep[:hsp]}<sup id="note\d+">\d+<\/sup>#{$ep[:hsp]}/m,''). - gsub(/<a[\n\s]+"[\n\s]+href="#note_ref\d+">#{$ep[:hsp]}<sup id="note\d+">\d+<\/sup>#{$ep[:hsp]}/m,'') #remove + gsub(/<a[\n\s]+"[\n\s]+href="##{Mx[:note_ref]}\d+">#{$ep[:hsp]}<sup id="#{Mx[:note]}\d+">\d+<\/sup>#{$ep[:hsp]}/m,''). + gsub(/<a[\n\s]+"[\n\s]+href="##{Mx[:note_ref]}\d+">#{$ep[:hsp]}<sup id="#{Mx[:note]}\d+">\d+<\/sup>#{$ep[:hsp]}/m,'') #remove end %{<#{tag} class="#{attrib}"> <a href="#o#{@ocn}"><i>#{txt}</i></a> #{note} |