Skip to content

Commit

Permalink
feat: allow 'auto' value for the 'dir' attribute of Package Documents
Browse files Browse the repository at this point in the history
Fix #1220
  • Loading branch information
rdeltour committed Nov 14, 2021
1 parent 52ebd80 commit a2e3a77
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -130,4 +130,4 @@
opf.id.attr = attribute id { datatype.ID }
opf.i18n.attrs = opf.xml.lang.attr? & opf.dir.attr?
opf.xml.lang.attr = attribute xml:lang { "" | datatype.string.nonempty }
opf.dir.attr = attribute dir { 'ltr' | 'rtl' }
opf.dir.attr = attribute dir { 'ltr' | 'rtl' | 'auto' }
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?>
<package dir="auto" xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid"
xmlns:dc="http://purl.org/dc/elements/1.1/">
<metadata>
<dc:title>Title</dc:title>
<dc:language>en</dc:language>
<dc:identifier id="uid">NOID</dc:identifier>
<meta property="dcterms:modified">2019-01-01T12:00:00Z</meta>
</metadata>
<manifest>
<item id="t001" href="contents.xhtml" properties="nav" media-type="application/xhtml+xml"/>
</manifest>
<spine>
<itemref idref="t001"/>
</spine>
</package>
4 changes: 4 additions & 0 deletions src/test/resources/epub3/package-document.feature
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ Feature: EPUB 3 ▸ Packages ▸ Package Document Checks
Then error RSC-005 is reported 2 times (once for each ID)
And no other errors or warnings are reported

Scenario: the 'dir' attribute value can be 'auto'
When checking file 'attr-dir-auto-valid.opf'
Then no errors or warnings are reported

Scenario: the 'xml:lang' attribute can be empty
When checking file 'attr-lang-empty-valid.opf'
Then no other errors or warnings are reported
Expand Down

0 comments on commit a2e3a77

Please sign in to comment.