-
Notifications
You must be signed in to change notification settings - Fork 402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] [fix #702] Validate content of <dc:language> #807
Closed
Closed
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f3494c0
First viable implementation of issue 702.
kalaspuffar a3631e9
Add error thrown for test with 'incorrect' language tags
kalaspuffar bf3df79
Remove verbose flag from tests
kalaspuffar aa7e12d
Change requirement to max 3 characters for language tag
kalaspuffar 2803029
Change warning to info.
kalaspuffar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
body { | ||
margin-left : 6em; | ||
margin-right : 16em; | ||
color:black; | ||
font-family: arial, helvetica, sans-serif; | ||
} |
19 changes: 19 additions & 0 deletions
19
src/test/resources/30/expanded/valid/issue702/EPUB/lorem.opf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" unique-identifier="uid"> | ||
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/"> | ||
<dc:identifier id="uid">urn:uuid:550e8400-e29b-41d4-a716-4466674412314</dc:identifier> | ||
<dc:title>Lorem Ipsum</dc:title> | ||
<dc:language>en-US</dc:language> | ||
<dc:language>en-US-POSIX</dc:language> | ||
<dc:language>invalid-language</dc:language> | ||
<dc:date>2011-09-01</dc:date> | ||
<meta property="dcterms:modified">2011-09-01T17:18:00Z</meta> | ||
</metadata> | ||
<manifest> | ||
<item id="t1" href="lorem.xhtml" properties="nav" media-type="application/xhtml+xml" /> | ||
<item id="css" href="lorem.css" media-type="text/css" /> | ||
</manifest> | ||
<spine> | ||
<itemref idref="t1" /> | ||
</spine> | ||
</package> |
109 changes: 109 additions & 0 deletions
109
src/test/resources/30/expanded/valid/issue702/EPUB/lorem.xhtml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="la" lang="la" | ||
xmlns:epub="http://www.idpf.org/2007/ops"> | ||
<head> | ||
<title>Lorem Ipsum</title> | ||
<link type="text/css" rel="stylesheet" href="lorem.css" /> | ||
<meta name="viewport" content="width=device-width" /> | ||
</head> | ||
<body> | ||
<h1>Lorem Ipsum</h1> | ||
<section> | ||
<h2>Table of Contents</h2> | ||
<nav epub:type="toc"> | ||
<ol> | ||
<li><a href="#ch1">Chapter 1</a></li> | ||
<li><a href="#ch2">Chapter 2</a></li> | ||
</ol> | ||
</nav> | ||
</section> | ||
<section id="ch1"> | ||
<h2>Chapter 1</h2> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam vel purus mauris, ut | ||
auctor massa. Pellentesque non nunc risus. Fusce a massa augue. Nunc erat ante, | ||
auctor id varius ac, vestibulum non purus. Quisque non dui in sem consectetur | ||
condimentum non ac quam. Quisque ultricies nulla nec urna fringilla pretium. | ||
Pellentesque dictum pulvinar purus in mattis. Aliquam vestibulum orci sed magna | ||
vestibulum a sollicitudin lectus pharetra. Suspendisse luctus risus imperdiet nunc | ||
condimentum malesuada. Nulla fringilla vulputate vestibulum. Sed diam dui, fringilla | ||
quis sagittis nec, viverra et nibh.</p> | ||
|
||
<p>Sed sollicitudin accumsan augue, quis pulvinar sem volutpat at. Vestibulum rutrum | ||
bibendum augue sit amet accumsan. Etiam tempus malesuada libero vestibulum | ||
fringilla. Maecenas diam nulla, ultricies ac sodales vitae, viverra ut velit. | ||
Vivamus posuere, mi sit amet vehicula tempus, nibh purus scelerisque enim, non | ||
vestibulum erat arcu in libero. Aliquam vel convallis nibh. Sed in nisi ipsum. Sed | ||
sed est justo, in lacinia nulla.</p> | ||
|
||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed luctus est vel lacus | ||
ullamcorper vestibulum. Mauris est sapien, pharetra id feugiat in, ornare a erat. | ||
Nam consectetur vehicula nisi vel faucibus. Morbi blandit augue nec lacus malesuada | ||
venenatis. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur | ||
ridiculus mus. Maecenas consectetur, odio vitae suscipit ullamcorper, arcu ligula | ||
pellentesque sem, quis rhoncus enim eros id lectus. Nam ornare dui est, vel posuere | ||
metus. Quisque non nisl metus. Pellentesque id mi nunc, in gravida metus. Nullam | ||
neque tellus, ultricies quis laoreet vitae, imperdiet at nunc. Ut laoreet massa quis | ||
quam vulputate et ultricies nibh consectetur. Donec convallis, nulla id ultricies | ||
ullamcorper, diam tortor interdum dolor, vel tempor lectus urna ut est. Praesent | ||
convallis lacus vitae justo lobortis euismod. In at ante elit.</p> | ||
|
||
<p>Aenean quis consectetur justo. Nulla nec enim nisl. Etiam rutrum volutpat tellus, a | ||
scelerisque mauris malesuada sit amet. Suspendisse quis urna augue. Proin tempus | ||
hendrerit libero non cursus. Praesent non massa at nisl luctus facilisis. Nullam | ||
pulvinar, ligula eu porta ornare, mi mi accumsan orci, a iaculis tortor lorem quis | ||
dolor. Phasellus ante nibh, pulvinar ac pulvinar eu, pulvinar ac enim.</p> | ||
|
||
<p>Donec vel velit id elit volutpat vestibulum vitae a erat. Duis id est id magna | ||
aliquam pretium nec sit amet nibh. Nullam condimentum suscipit felis, sed interdum | ||
felis dictum ac. Phasellus non nisi quis magna pellentesque auctor. Cras risus | ||
lectus, viverra eu fringilla malesuada, rhoncus et est. Etiam rhoncus pharetra | ||
accumsan. Nullam suscipit tellus felis.</p> | ||
</section> | ||
<section id="ch2"> | ||
<h2>Chapter 2</h2> | ||
<p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nulla laoreet nibh felis. | ||
Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia | ||
Curae; Etiam est sapien, dapibus eget gravida nec, accumsan a turpis. Nunc in nisi | ||
ut dolor elementum porttitor. Mauris hendrerit pulvinar tincidunt. Etiam metus | ||
metus, ullamcorper ut varius lacinia, luctus et nibh. Donec ut metus enim, id | ||
faucibus nunc. Quisque ut iaculis mauris. Duis pellentesque nulla ut eros ultricies | ||
quis condimentum eros adipiscing. Sed porta ultrices diam, ut sagittis lectus mattis | ||
a. Phasellus gravida, sapien vitae mollis interdum, dui neque tempor arcu, ac ornare | ||
leo ipsum ut nisl.</p> | ||
|
||
<p>Donec porta, odio et aliquet molestie, felis tellus fermentum leo, id interdum magna | ||
massa quis ligula. Integer elementum mauris eget nisl eleifend facilisis nec sit | ||
amet tellus. Morbi consectetur dignissim egestas. Donec pulvinar, enim eu auctor | ||
cursus, turpis arcu venenatis turpis, eu cursus magna nisl sit amet ante. Curabitur | ||
eleifend arcu eget nibh facilisis mattis. Etiam nisl nunc, semper vitae condimentum | ||
sed, viverra sit amet lacus. Curabitur et orci augue. Suspendisse sollicitudin | ||
vulputate risus, sit amet consequat erat mollis eu. Nunc sodales tincidunt | ||
tincidunt.</p> | ||
|
||
<p>Aliquam erat volutpat. Aliquam ornare augue et nulla consequat commodo. Quisque | ||
dictum rhoncus orci vel euismod. Proin leo turpis, adipiscing quis facilisis id, | ||
condimentum sed metus. Nullam pellentesque scelerisque est nec tristique. Nunc augue | ||
turpis, consequat non varius quis, aliquam auctor dolor. Cras luctus dignissim justo | ||
sit amet laoreet. Quisque vel ipsum quis massa suscipit vehicula.</p> | ||
|
||
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis | ||
egestas. Vivamus fringilla eleifend magna, vel commodo turpis egestas at. | ||
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis | ||
egestas. Sed eu lorem quam, et sagittis libero. Maecenas vel ante id sem bibendum | ||
laoreet nec dignissim justo. Class aptent taciti sociosqu ad litora torquent per | ||
conubia nostra, per inceptos himenaeos. Fusce eu lorem orci, eu viverra nisi. Lorem | ||
ipsum dolor sit amet, consectetur adipiscing elit. Vestibulum dapibus commodo | ||
pellentesque. Maecenas quis est accumsan est interdum pharetra egestas nec lorem. | ||
Nam a lectus sit amet justo facilisis suscipit.</p> | ||
|
||
<p>Integer dolor dolor, volutpat id commodo id, gravida id risus. Donec consectetur | ||
sollicitudin sem, non auctor urna pulvinar non. Vivamus ipsum nisi, commodo sed | ||
scelerisque id, porta nec massa. Vestibulum ac risus et augue faucibus fermentum ut | ||
et nisi. Integer tincidunt suscipit ipsum, sed interdum felis mollis sed. | ||
Suspendisse potenti. Praesent et mauris et quam consequat tristique. Morbi mi dolor, | ||
pharetra quis rutrum quis, fringilla in tortor. Sed a nulla vitae leo dapibus | ||
cursus. Aliquam erat volutpat. Integer purus purus, dictum id bibendum at, lobortis | ||
quis metus.</p> | ||
</section> | ||
</body> | ||
</html> |
7 changes: 7 additions & 0 deletions
7
src/test/resources/30/expanded/valid/issue702/META-INF/container.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<container xmlns="urn:oasis:names:tc:opendocument:xmlns:container" version="1.0"> | ||
<rootfiles> | ||
<rootfile full-path="EPUB/lorem.opf" | ||
media-type="application/oebps-package+xml"/> | ||
</rootfiles> | ||
</container> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
application/epub+zip |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK.
A more thorough validation would be to use IANA’s language tag registry, but this is probably overkill?