Skip to content

Commit 58cb128

Browse files
authored
control attribute order of meta tag
in meta tag name should appear eariler than content attribute
1 parent dcbcb6b commit 58cb128

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

ebooklib/epub.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
import uuid
2121
import posixpath as zip_path
2222
import os.path
23+
from collections import OrderedDict
2324

2425
try:
2526
from urllib.parse import unquote
@@ -612,7 +613,7 @@ def set_cover(self, file_name, content, create_page=True):
612613
c1 = EpubCoverHtml(image_name=file_name)
613614
self.add_item(c1)
614615

615-
self.add_metadata(None, 'meta', '', {'name': 'cover', 'content': 'cover-img'})
616+
self.add_metadata(None, 'meta', '', OrderedDict([('name', 'cover'), ('content', 'cover-img')]))
616617

617618
def add_author(self, author, file_as=None, role=None, uid='creator'):
618619
"Add author for this document"

0 commit comments

Comments
 (0)