Skip to content

Commit

Permalink
Add tests for t-075
Browse files Browse the repository at this point in the history
  • Loading branch information
acabal committed May 10, 2024
1 parent a94d8e6 commit a733796
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 2 deletions.
3 changes: 3 additions & 0 deletions tests/lint/typography/t-074/golden/t-074-out.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ t-074 [Manual Review] chapter-1.xhtml Extended sound using hyphen-minus `-`
instead of non-breaking hyphen `‑`.
<i>Bor-r-r-r-n!</i>
<em>Ow-w-w!</em>
y-003 [Manual Review] chapter-1.xhtml Possible typo: paragraph missing ending
punctuation.
<p><i xml:lang="fr">X-x-x-x</i></p>
8 changes: 6 additions & 2 deletions tests/lint/typography/t-074/in/src/epub/text/chapter-1.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,14 @@
<body epub:type="bodymatter z3998:fiction">
<section id="chapter-1" epub:type="chapter">
<h2 epub:type="ordinal z3998:roman">I</h2>
<p><!-- ignore, not a sound --><i>Bon-bon.</i></p>
<!-- Ignore, not a sound -->
<p><i>Bon-bon.</i></p>
<p><i>Bor-r-r-r-n!</i></p>
<p><em>Ow-w-w!</em></p>
<p><!-- ignore, too long --><i>Can this be the Seigneur du Vallon de Bracieux de Pierrefonds? Well-a-day! how he has shrunk since he gave up the name of Porthos!</i></p>
<!-- Ignore, language -->
<p><i xml:lang="fr">X-x-x-x</i></p>
<!-- Ignore, too long -->
<p><i>Can this be the Seigneur du Vallon de Bracieux de Pierrefonds? Well-a-day! how he has shrunk since he gave up the name of Porthos!</i></p>
</section>
</body>
</html>
4 changes: 4 additions & 0 deletions tests/lint/typography/t-075/golden/t-075-out.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
t-075 [Manual Review] chapter-1.xhtml Word in verse with acute accent for
scansion instead of grave accent.
<span>He forcéd</span>
<span>The accurséd</span>
21 changes: 21 additions & 0 deletions tests/lint/typography/t-075/in/src/epub/css/local.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
@charset "utf-8";
@namespace epub "http://www.idpf.org/2007/ops";

[epub|type~="z3998:poem"] p{
text-align: initial;
text-indent: 0;
}

[epub|type~="z3998:poem"] p + p{
margin-top: 1em;
}

[epub|type~="z3998:poem"] p > span{
display: block;
padding-left: 1em;
text-indent: -1em;
}

[epub|type~="z3998:poem"] p > span + br{
display: none;
}
41 changes: 41 additions & 0 deletions tests/lint/typography/t-075/in/src/epub/text/chapter-1.xhtml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<?xml version="1.0" encoding="utf-8"?>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" epub:prefix="z3998: http://www.daisy.org/z3998/2012/vocab/structure/, se: https://standardebooks.org/vocab/1.0" xml:lang="en-GB">
<head>
<title>I</title>
<link href="../css/core.css" rel="stylesheet" type="text/css"/>
<link href="../css/local.css" rel="stylesheet" type="text/css"/>
</head>
<body epub:type="bodymatter z3998:fiction">
<section id="chapter-1" epub:type="chapter">
<h2 epub:type="ordinal z3998:roman">I</h2>
<!-- Ignore, not verse-->
<p>Accurséd</p>
<blockquote epub:type="z3998:poem">
<p>
<!-- Ignore, child element with language -->
<span>Hello <i xml:lang="fr">tést</i></span>
<br/>
<!-- Ignore, whitelisted word -->
<span>The café</span>
<br/>
<!-- Match, but only the child <span>, not parent AND child -->
<span class="dl2">
<span>He forcéd</span>
<br/>
<span>Test</span>
</span>
<br/>
<!-- Ignore, not in the dictionary so probably a name -->
<span>Kórolenko</span>
<br/>
<!-- Match -->
<span>The accurséd</span>
</p>
<p xml:lang="fr">
<!-- Ignore, parent element with language -->
<span>The wingéd</span>
</p>
</blockquote>
</section>
</body>
</html>

0 comments on commit a733796

Please sign in to comment.