aboutsummaryrefslogtreecommitdiffhomepage
path: root/lib/sisu/v3/epub_format.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sisu/v3/epub_format.rb')
-rw-r--r--lib/sisu/v3/epub_format.rb24
1 files changed, 23 insertions, 1 deletions
diff --git a/lib/sisu/v3/epub_format.rb b/lib/sisu/v3/epub_format.rb
index 9f169f5e..6879c933 100644
--- a/lib/sisu/v3/epub_format.rb
+++ b/lib/sisu/v3/epub_format.rb
@@ -1057,6 +1057,28 @@ WOK
%{\n <dc:creator opf:file-as="#{m}" opf:role="aut">#{x}</dc:creator>}
else ''
end
+ editor=if defined? @md.creator.editor \
+ and @md.creator.editor =~/\S+/
+ m=''
+ @md.creator.editor_detail.each do |x|
+ surname=x[:the] \
+ ? x[:the] \
+ : ''
+ other_names=x[:others] \
+ ? ', ' + x[:others] \
+ : ''
+ m=(m.empty?) \
+ ? (surname + other_names) \
+ : (m + '; ' + surname + ', ' + other_names)
+ m.gsub!(/</,'&lt;'); m.gsub!(/>/,'&gt;')
+ m.gsub!(/&lt;br(?: \/)?&gt;/,';')
+ end
+ x=@md.creator.editor.dup
+ x.gsub!(/</,'&lt;'); x.gsub!(/>/,'&gt;')
+ x.gsub!(/&lt;br(?: \/)?&gt;/,'<br />')
+ %{\n <dc:creator opf:file-as="#{m}" opf:role="edt">#{x}</dc:creator>}
+ else ''
+ end
translator=if defined? @md.creator.translator \
and @md.creator.translator =~/\S+/
m=''
@@ -1132,7 +1154,7 @@ WOK
<<WOK
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:opf="http://www.idpf.org/2007/opf">
<dc:title>#{@md.title.full}</dc:title>
- #{author}#{translator}#{illustrator}#{language}#{date_published}#{subject}#{rights}
+ #{author}#{editor}#{translator}#{illustrator}#{language}#{date_published}#{subject}#{rights}
<dc:identifier id="bookid">...</dc:identifier>
<dc:identifier id="EPB-UUID">urn:uuid:#{@md.dgst[1]}</dc:identifier>
</metadata>