From 0a502e5ff52b251bbf3da69fd1f9a88d5e0fe92c Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Thu, 10 Dec 2020 15:44:10 -0800 Subject: HTML reader: retain attribute prefixes and avoid duplicates. Previously we stripped attribute prefixes, reading `xml:lang` as `lang` for example. This resulted in two duplicate `lang` attributes when `xml:lang` and `lang` were both used. This commit causes the prefixes to be retained, and also avoids invald duplicate attributes. Closes #6938. --- test/epub/wasteland.native | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'test/epub') diff --git a/test/epub/wasteland.native b/test/epub/wasteland.native index 0ed23eba2..ff59182a6 100644 --- a/test/epub/wasteland.native +++ b/test/epub/wasteland.native @@ -1,8 +1,8 @@ [Para [Image ("",[],[]) [] ("wasteland-cover.jpg","")] ,Para [Span ("wasteland-content.xhtml",[],[]) []] -,Div ("wasteland-content.xhtml#frontmatter",["section"],[("type","frontmatter")]) +,Div ("wasteland-content.xhtml#frontmatter",["section","frontmatter"],[]) [] -,Div ("wasteland-content.xhtml#bodymatter",["section"],[("type","bodymatter")]) +,Div ("wasteland-content.xhtml#bodymatter",["section","bodymatter"],[]) [Div ("wasteland-content.xhtml#ch1",["section"],[]) [Header 2 ("",[],[]) [Str "I.",Space,Str "THE",Space,Str "BURIAL",Space,Str "OF",Space,Str "THE",Space,Str "DEAD"] ,Div ("",["linegroup"],[]) @@ -922,8 +922,8 @@ [Plain [Str "Datta.",Space,Str "Dayadhvam.",Space,Str "Damyata."]] ,Div ("wasteland-content.xhtml#ln434",["linegroup","indent"],[]) [Plain [Span ("",[],[("lang","sa")]) [Str "Shantih",Space,Str "shantih",Space,Str "shantih",Note [Para [Link ("",[],[]) [Str "434."] ("#wasteland-content.xhtml#ln434",""),Space,Str "Shantih.",Space,Str "Repeated",Space,Str "as",Space,Str "here,",Space,Str "a",Space,Str "formal",Space,Str "ending",Space,Str "to",Space,Str "an",Space,Str "Upanishad.",Space,Str "'The",SoftBreak,Str "Peace",Space,Str "which",Space,Str "passeth",Space,Str "understanding'",Space,Str "is",Space,Str "a",Space,Str "feeble",Space,Str "translation",Space,Str "of",Space,Str "the",SoftBreak,Str "content",Space,Str "of",Space,Str "this",Space,Str "word."]],SoftBreak]]]]]] -,Div ("wasteland-content.xhtml#backmatter",["section"],[("type","backmatter")]) - [Div ("wasteland-content.xhtml#rearnotes",["section"],[("type","rearnotes")]) +,Div ("wasteland-content.xhtml#backmatter",["section","backmatter"],[]) + [Div ("wasteland-content.xhtml#rearnotes",["section","rearnotes"],[]) [Header 2 ("",[],[]) [Str "NOTES",Space,Str "ON",Space,Str "\"THE",Space,Str "WASTE",Space,Str "LAND\""] ,Para [Str "Not",Space,Str "only",Space,Str "the",Space,Str "title,",Space,Str "but",Space,Str "the",Space,Str "plan",Space,Str "and",Space,Str "a",Space,Str "good",Space,Str "deal",Space,Str "of",Space,Str "the",Space,Str "incidental",Space,Str "symbolism",Space,Str "of",SoftBreak,Str "the",Space,Str "poem",Space,Str "were",Space,Str "suggested",Space,Str "by",Space,Str "Miss",Space,Str "Jessie",Space,Str "L.",Space,Str "Weston's",Space,Str "book",Space,Str "on",Space,Str "the",Space,Str "Grail",Space,Str "legend:",SoftBreak,Str "From",Space,Str "Ritual",Space,Str "to",Space,Str "Romance"] ,Para [Str "Indeed,",Space,Str "so",Space,Str "deeply",Space,Str "am",Space,Str "I",Space,Str "indebted,",Space,Str "Miss",Space,Str "Weston's",Space,Str "book",Space,Str "will",Space,Str "elucidate",Space,Str "the",SoftBreak,Str "difficulties",Space,Str "of",Space,Str "the",Space,Str "poem",Space,Str "much",Space,Str "better",Space,Str "than",Space,Str "my",Space,Str "notes",Space,Str "can",Space,Str "do;",Space,Str "and",Space,Str "I",Space,Str "recommend",Space,Str "it",SoftBreak,Str "(apart",Space,Str "from",Space,Str "the",Space,Str "great",Space,Str "interest",Space,Str "of",Space,Str "the",Space,Str "book",Space,Str "itself)",Space,Str "to",Space,Str "any",Space,Str "who",Space,Str "think",Space,Str "such",SoftBreak,Str "elucidation",Space,Str "of",Space,Str "the",Space,Str "poem",Space,Str "worth",Space,Str "the",Space,Str "trouble.",Space,Str "To",Space,Str "another",Space,Str "work",Space,Str "of",Space,Str "anthropology",Space,Str "I",Space,Str "am",SoftBreak,Str "indebted",Space,Str "in",Space,Str "general,",Space,Str "one",Space,Str "which",Space,Str "has",Space,Str "influenced",Space,Str "our",Space,Str "generation",Space,Str "profoundly;",Space,Str "I",Space,Str "mean",SoftBreak,Str "The",Space,Str "Golden",Space,Str "Bough;",Space,Str "I",Space,Str "have",Space,Str "used",Space,Str "especially",Space,Str "the",Space,Str "two",Space,Str "volumes",Space,Str "Adonis,",Space,Str "Attis,",Space,Str "Osiris.",SoftBreak,Str "Anyone",Space,Str "who",Space,Str "is",Space,Str "acquainted",Space,Str "with",Space,Str "these",Space,Str "works",Space,Str "will",Space,Str "immediately",Space,Str "recognise",Space,Str "in",Space,Str "the",Space,Str "poem",SoftBreak,Str "certain",Space,Str "references",Space,Str "to",Space,Str "vegetation",Space,Str "ceremonies."] -- cgit v1.2.3 From 63a6059790f24b02c594548bd42e01cd082768a0 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Mon, 15 Mar 2021 18:22:38 -0700 Subject: Update tests for new texmath. --- test/epub/features.native | 4 ++-- test/writer.jats_archiving | 2 +- test/writer.jats_articleauthoring | 2 +- test/writer.jats_publishing | 2 +- test/writer.ms | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) (limited to 'test/epub') diff --git a/test/epub/features.native b/test/epub/features.native index 51a2881af..86a61360e 100644 --- a/test/epub/features.native +++ b/test/epub/features.native @@ -65,12 +65,12 @@ ,Div ("content-mathml-001.xhtml#mathml-025",["section","ctest"],[]) [Header 2 ("",[],[]) [Span ("",["nature"],[]) [Str "[REQUIRED]"],SoftBreak,Span ("",["test-id"],[]) [Str "mathml-025"],Str "Testing",Space,Code ("",[],[]) "mtable",Space,Str "with",Space,Code ("",[],[]) "colspan",Space,Str "and",Space,Code ("",[],[]) "rowspan",Space,Str "attributes,",Space,Str "Hebrew",Space,Str "and",Space,Str "Script",Space,Str "fonts"] ,Para [Str "Tests",Space,Str "whether",Space,Code ("",[],[]) "mtable",Space,Str "with",Space,Code ("",[],[]) "colspan",Space,Str "and",Space,Code ("",[],[]) "mspace",Space,Str "attributes",Space,Str "(column",Space,Str "and",Space,Str "row",Space,Str "spanning)",Space,Str "are",Space,Str "supported;",Space,Str "uses",Space,Str "Hebrew",Space,Str "and",Space,Str "Script",Space,Str "alphabets."] - ,Plain [Math DisplayMath "\\begin{matrix}\n & {\\operatorname{cov}\\left( \\mathcal{L} \\right)} & \\longrightarrow & {\\operatorname{non}\\left( \\mathcal{K} \\right)} & \\longrightarrow & {\\operatorname{cof}\\left( \\mathcal{K} \\right)} & \\longrightarrow & {\\operatorname{cof}\\left( \\mathcal{L} \\right)} & \\longrightarrow & 2^{\\aleph_{0}} \\\\\n & \\uparrow & & \\uparrow & & \\uparrow & & \\uparrow & & \\\\\n & {\\mathfrak{b}} & \\longrightarrow & {\\mathfrak{d}} & & & & & & \\\\\n & \\uparrow & & \\uparrow & & & & & & \\\\\n\\aleph_{1} & \\longrightarrow & {\\operatorname{add}\\left( \\mathcal{L} \\right)} & \\longrightarrow & {\\operatorname{add}\\left( \\mathcal{K} \\right)} & \\longrightarrow & {\\operatorname{cov}\\left( \\mathcal{K} \\right)} & \\longrightarrow & {\\operatorname{non}\\left( \\mathcal{L} \\right)} & \\\\\n\\end{matrix}"] + ,Plain [Math DisplayMath "\\begin{matrix}\n & {\\operatorname{cov}(\\mathcal{L})} & \\longrightarrow & {\\operatorname{non}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{cof}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{cof}(\\mathcal{L})} & \\longrightarrow & 2^{\\aleph_{0}} \\\\\n & \\uparrow & & \\uparrow & & \\uparrow & & \\uparrow & & \\\\\n & {\\mathfrak{b}} & \\longrightarrow & {\\mathfrak{d}} & & & & & & \\\\\n & \\uparrow & & \\uparrow & & & & & & \\\\\n\\aleph_{1} & \\longrightarrow & {\\operatorname{add}(\\mathcal{L})} & \\longrightarrow & {\\operatorname{add}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{cov}(\\mathcal{K})} & \\longrightarrow & {\\operatorname{non}(\\mathcal{L})} & \\\\\n\\end{matrix}"] ,Para [Str "The",Space,Str "test",Space,Str "passes",Space,Str "if",Space,Str "the",Space,Str "rendering",Space,Str "looks",Space,Str "like",Space,Link ("",[],[]) [Str "Cicho\324's",Space,Str "Diagram"] ("http://en.wikipedia.org/wiki/Cicho%C5%84's_diagram",""),Str ":",Space,Str "."]] ,Div ("content-mathml-001.xhtml#mathml-026",["section","ctest"],[]) [Header 2 ("",[],[]) [Span ("",["nature"],[]) [Str "[REQUIRED]"],SoftBreak,Span ("",["test-id"],[]) [Str "mathml-026"],Str "BiDi,",Space,Str "RTL",Space,Str "and",Space,Str "Arabic",Space,Str "alphabets"] ,Para [Str "Tests",Space,Str "whether",Space,Str "right-to-left",Space,Str "and",Space,Str "Arabic",Space,Str "alphabets",Space,Str "are",Space,Str "supported."] - ,Plain [Math DisplayMath "{\1583\\left( \1587 \\right)} = \\left\\{ \\begin{matrix}\n{\\sum\\limits_{\1646 = 1}^{\1589}\1587^{\1646}} & {\\text{\1573\1584\1575\1603\1575\1606}\1587 > 0} \\\\\n{\\int_{1}^{\1589}{\1587^{\1646}\1569\1587}} & {\\text{\1573\1584\1575\1603\1575\1606}\1587 \\in \1605} \\\\\n{{\1591\1575}\\pi} & {\\text{\1594\1610\1585\1584\1604\1603}\\left( \\text{\1605\1593}\\pi \\simeq 3,141 \\right)} \\\\\n\\end{matrix} \\right."] + ,Plain [Math DisplayMath "{\1583(\1587)} = \\left\\{ \\begin{matrix}\n{\\sum\\limits_{\1646 = 1}^{\1589}\1587^{\1646}} & {\\text{\1573\1584\1575\1603\1575\1606}\1587 > 0} \\\\\n{\\int_{1}^{\1589}{\1587^{\1646}\1569\1587}} & {\\text{\1573\1584\1575\1603\1575\1606}\1587 \\in \1605} \\\\\n{{\1591\1575}\\pi} & {\\text{\1594\1610\1585\1584\1604\1603}\\left( \\text{\1605\1593}\\pi \\simeq 3,141 \\right)} \\\\\n\\end{matrix} \\right."] ,Para [Str "The",Space,Str "test",Space,Str "passes",Space,Str "if",Space,Str "the",Space,Str "rendering",Space,Str "looks",Space,Str "like",Space,Str "the",Space,Str "following",Space,Str "image:"]] ,Div ("content-mathml-001.xhtml#mathml-027",["section","ctest"],[]) [Header 2 ("",[],[]) [Span ("",["nature"],[]) [Str "[REQUIRED]"],SoftBreak,Span ("",["test-id"],[]) [Str "mathml-027"],Str "Elementary",Space,Str "math:",Space,Str "long",Space,Str "division",Space,Str "notation"] diff --git a/test/writer.jats_archiving b/test/writer.jats_archiving index a6ff94bcd..1a9537a21 100644 --- a/test/writer.jats_archiving +++ b/test/writer.jats_archiving @@ -694,7 +694,7 @@ These should not be escaped: \$ \\ \> \[ \{

Here’s some display math: - ddxf(x)=limh0f(x+h)f(x)h

+ ddxf(x)=limh0f(x+h)f(x)h

Here’s one that has a line break in it: diff --git a/test/writer.jats_articleauthoring b/test/writer.jats_articleauthoring index 65ad5e37c..956a30faa 100644 --- a/test/writer.jats_articleauthoring +++ b/test/writer.jats_articleauthoring @@ -676,7 +676,7 @@ These should not be escaped: \$ \\ \> \[ \{

Here’s some display math: - ddxf(x)=limh0f(x+h)f(x)h

+ ddxf(x)=limh0f(x+h)f(x)h

Here’s one that has a line break in it: diff --git a/test/writer.jats_publishing b/test/writer.jats_publishing index eb3f8faab..b85816848 100644 --- a/test/writer.jats_publishing +++ b/test/writer.jats_publishing @@ -694,7 +694,7 @@ These should not be escaped: \$ \\ \> \[ \{

Here’s some display math: - ddxf(x)=limh0f(x+h)f(x)h

+ ddxf(x)=limh0f(x+h)f(x)h

Here’s one that has a line break in it: diff --git a/test/writer.ms b/test/writer.ms index 4fa6589ed..329c959fc 100644 --- a/test/writer.ms +++ b/test/writer.ms @@ -700,7 +700,7 @@ LaTeX .IP \[bu] 3 Here\[cq]s some display math: .EQ -d over {d x} f ( x ) = lim sub {h -> 0} {f ( x + h ) \[u2212] f ( x )} over h +d over {d x} f left ( x right ) = lim sub {h -> 0} {f left ( x + h right ) \[u2212] f left ( x right )} over h .EN .IP \[bu] 3 Here\[cq]s one that has a line break in it: @alpha + omega times x sup 2@. -- cgit v1.2.3 From 5cf887db20b723e3aee172f8ecbc31ca95f69542 Mon Sep 17 00:00:00 2001 From: John MacFarlane Date: Sat, 29 May 2021 11:48:52 -0700 Subject: Reduce size of cover image in test epub. --- test/Tests/Readers/EPUB.hs | 2 +- test/epub/wasteland.epub | Bin 101870 -> 35496 bytes 2 files changed, 1 insertion(+), 1 deletion(-) (limited to 'test/epub') diff --git a/test/Tests/Readers/EPUB.hs b/test/Tests/Readers/EPUB.hs index 13e239911..040fc96e7 100644 --- a/test/Tests/Readers/EPUB.hs +++ b/test/Tests/Readers/EPUB.hs @@ -47,7 +47,7 @@ featuresBag = [("img/check.gif","image/gif",1340) -- with additional meta tag for cover in EPUB2 format epub3CoverBag :: [(String, String, Int)] -epub3CoverBag = [("wasteland-cover.jpg","image/jpeg",103477)] +epub3CoverBag = [("wasteland-cover.jpg","image/jpeg", 16586)] epub3NoCoverBag :: [(String, String, Int)] epub3NoCoverBag = [("img/check.gif","image/gif",1340) diff --git a/test/epub/wasteland.epub b/test/epub/wasteland.epub index e4e52db7f..c958c5fc2 100644 Binary files a/test/epub/wasteland.epub and b/test/epub/wasteland.epub differ -- cgit v1.2.3