Skip to content

Commit

Permalink
test: add a test for a valid MathML altimg ref
Browse files Browse the repository at this point in the history
See also #1492
  • Loading branch information
rdeltour committed Apr 22, 2023
1 parent 2332d53 commit 2370940
Show file tree
Hide file tree
Showing 12 changed files with 63 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -425,9 +425,14 @@ Feature: EPUB 3 — Content Documents — XHTML

#### MathML

@spec @xref:sec-manifest-elem
Scenario: Allow a MathML formula with an alternative image
When checking EPUB 'content-xhtml-mathml-altimg-valid'
Then no other errors or warnings are reported

@spec @xref:sec-manifest-elem
Scenario: Report a MathML formula with an alternative image that cannot be found
When checking EPUB 'content-xhtml-mathml-altimg-not-found-warning'
When checking EPUB 'content-xhtml-mathml-altimg-not-found-error'
Then error RSC-007 is reported
And no other errors or warnings are reported

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:m="http://www.w3.org/1998/Math/MathML"
xml:lang="en" lang="en">
<head>
<meta charset="utf-8" />
<title>Minimal EPUB</title>
</head>
<body>
<h1>Loomings</h1>
<p>Call me Ishmael.</p>
<m:math display="inline" alttext="10x10" altimg="images/math.jpg">
<m:mrow>
<m:mn>10</m:mn>
<m:mo>×</m:mo>
<m:mn>10</m:mn>
</m:mrow>
</m:math>
</body>
</html>
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:epub="http://www.idpf.org/2007/ops" xml:lang="en" lang="en">
<head>
<meta charset="utf-8"/>
<title>Minimal Nav</title>
</head>
<body>
<nav epub:type="toc">
<ol>
<li><a href="content_001.xhtml">content 001</a></li>
</ol>
</nav>
</body>
</html>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8"?>
<package xmlns="http://www.idpf.org/2007/opf" version="3.0" xml:lang="en" unique-identifier="q">
<metadata xmlns:dc="http://purl.org/dc/elements/1.1/">
<dc:title id="title">Minimal EPUB 3.0</dc:title>
<dc:language>en</dc:language>
<dc:identifier id="q">NOID</dc:identifier>
<meta property="dcterms:modified">2017-06-14T00:00:01Z</meta>
</metadata>
<manifest>
<item id="content_001" properties="mathml" href="content_001.xhtml" media-type="application/xhtml+xml"/>
<item id="nav" href="nav.xhtml" media-type="application/xhtml+xml" properties="nav"/>
<item id="math" href="images/math.jpg" media-type="image/jpeg"/>
</manifest>
<spine>
<itemref idref="content_001" />
</spine>
</package>
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="UTF-8" ?>
<container version="1.0" xmlns="urn:oasis:names:tc:opendocument:xmlns:container">
<rootfiles>
<rootfile full-path="EPUB/package.opf" media-type="application/oebps-package+xml"/>
</rootfiles>
</container>
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
application/epub+zip

0 comments on commit 2370940

Please sign in to comment.