View Single Post
Old 07-07-2018, 01:05 PM   #2
Doitsu
Grand Sorcerer
Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.Doitsu ought to be getting tired of karma fortunes by now.
 
Doitsu's Avatar
 
Posts: 5,584
Karma: 22735033
Join Date: Dec 2010
Device: Kindle PW2
I don't have a Mac, but I was able to reproduce the problem with an epub file generated by Pages for iOS 4.1. (The source was Kovid Goyal's docx test file.)

Apparently Pages adds an onload Javascript attribute to all <body> tags.

A typical HTML file looks like this:

Spoiler:
Code:
<?xml version="1.0" encoding="UTF-8"?>
<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">

<head>
    <title>5 Lists | demo 4</title>
    <link rel="stylesheet" href="css/book.css" type="text/css" />
    <script src="js/book.js" />
    <meta charset="UTF-8" />
    <meta name="EPB-UUID" content="0945EA89-B14C-4079-ADF8-8058C7750C59" />
</head>

<body dir="ltr" onload="Body_onLoad()">
    <div class="body" style="white-space:pre-wrap; line-break:strict;">
        <h1 class="p1" style=""><span id="chapter-5" />Lists</h1>
        <p class="p3" style="">All types of lists are supported by the conversion, with the exception of lists that use fancy bullets, these get converted to regular bullets.</p>
        <h2 class="p2" style=""><span id="chapter-5-49" />Bulleted List</h2>
        <ol style="padding:0 0 0 1px; margin:0;">
            <li class="p37 p38 li1 b1" style=""><span class="c1 c23">One</span></li>
        </ol>
        <ol style="padding:0 0 0 1px; margin:0;">
            <li class="p37 p38 li1 b1" style=""><span class="c1 c23">Two</span></li>
        </ol>
        <h2 class="p2" style=""><span id="chapter-5-52" />Numbered List</h2>
        <ol style="padding:0; margin:0;">
            <li value="1" class="p37 p38 li2 b2" style=""><span class="c1 c21">One, with a very long line to demonstrate that the hanging indent for the list is working correctly</span></li>
        </ol>
        <ol style="padding:0; margin:0;">
            <li value="2" class="p37 p38 li2 b2" style=""><span class="c1 c21">Two</span></li>
        </ol>
        <h2 class="p2" style=""><span id="chapter-5-55" />Multi-level Lists</h2>
        <ol style="padding:0; margin:0;">
            <li value="1" class="p39 p40 li2 b2" style=""><span class="c1 c21">One</span></li>
        </ol>
        <p class="p41 p42" style=""><span class="c24"><bdi>1.1.</bdi></span><span class="c1">Two</span></p>
        <p class="p43 p44" style=""><span class="c25"><bdi>1.1.1.</bdi></span><span class="c1">Three</span></p>
        <p class="p43 p44" style=""><span class="c25"><bdi>1.1.2.</bdi></span><span class="c1">Four with a very long line to demonstrate that the hanging indent for the list is working correctly.</span></p>
        <p class="p43 p44" style=""><span class="c25"><bdi>1.1.3.</bdi></span><span class="c1">Five</span></p>
        <ol style="padding:0; margin:0;">
            <li value="2" class="p39 p40 li2 b2" style=""><span class="c1 c21">Six</span></li>
        </ol>
        <p class="p45 p46" style="">A Multi-level list with bullets:</p>
        <ol style="padding:0 0 0 1px; margin:0;">
            <li class="p39 p40 li3 b3" style=""><span class="c1 c23">One</span></li>
        </ol>
        <ol style="padding:0 0 0 1px; margin:0;">
            <li class="p47 p48 li1 b1" style=""><span class="c1 c23">Two</span></li>
        </ol>
        <p class="p49 p50" style=""><span class="c26"><img src="images/image1.gif" alt="bullet" style="vertical-align:baseline;width:1.000em;"/></span><span class="c1">This bullet uses an image as the bullet item</span></p>
        <p class="p51 p52" style=""><span class="c27"><bdi>o</bdi></span><span class="c1">Four</span></p>
        <ol style="padding:0 0 0 1px; margin:0;">
            <li class="p39 p40 li3 b3" style=""><span class="c1 c23">Five</span></li>
        </ol>
        <h2 class="p2" style=""><span id="chapter-5-68" />Continued Lists</h2>
        <ol style="padding:0; margin:0;">
            <li value="1" class="p53 p54 li4 b4" style=""><span class="c1 c21">One</span></li>
        </ol>
        <ol style="padding:0; margin:0;">
            <li value="2" class="p53 p54 li4 b5" style=""><span class="c1 c21">Two</span></li>
        </ol>
        <p class="p55" style="">An interruption in our regularly scheduled listing, for this essential and very relevant public service announcement.</p>
        <ol style="padding:0; margin:0;">
            <li value="3" class="p53 p54 li4 b6" style=""><span class="c1 c21">We now resume our normal programming</span></li>
        </ol>
        <ol style="padding:0; margin:0;">
            <li value="4" class="p53 p54 li4 b7" style=""><span class="c1 c21">Four</span></li>
        </ol>
        <p class="p3 p56" style=""> </p>
    </div>
</body>

</html>


After selecting Mend & Prettify Code, it looks like this:

Spoiler:
Code:
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html>

<html xml:lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head>
  <title>5 Lists | demo 4</title>
  <link rel="stylesheet" href="css/book.css" type="text/css"/>
  <script src="js/book.js"></script>
</head>

<body>
  &lt;meta charset="UTF-8" /&gt;
    &lt;meta name="EPB-UUID" content="0945EA89-B14C-4079-ADF8-8058C7750C59" /&gt;
&lt;/head&gt;

&lt;body dir="ltr" onload="Body_onLoad()"&gt;
    &lt;div class="body" style="white-space:pre-wrap; line-break:strict;"&gt;
        &lt;h1 class="p1" style=""&gt;&lt;span id="chapter-5" /&gt;Lists&lt;/h1&gt;
        &lt;p class="p3" style=""&gt;All types of lists are supported by the conversion, with the exception of lists that use fancy bullets, these get converted to regular bullets.&lt;/p&gt;
        &lt;h2 class="p2" style=""&gt;&lt;span id="chapter-5-49" /&gt;Bulleted List&lt;/h2&gt;
        &lt;ol style="padding:0 0 0 1px; margin:0;"&gt;
            &lt;li class="p37 p38 li1 b1" style=""&gt;&lt;span class="c1 c23"&gt;One&lt;/span&gt;&lt;/li&gt;
        &lt;/ol&gt;
        &lt;ol style="padding:0 0 0 1px; margin:0;"&gt;
            &lt;li class="p37 p38 li1 b1" style=""&gt;&lt;span class="c1 c23"&gt;Two&lt;/span&gt;&lt;/li&gt;
        &lt;/ol&gt;
        &lt;h2 class="p2" style=""&gt;&lt;span id="chapter-5-52" /&gt;Numbered List&lt;/h2&gt;
        &lt;ol style="padding:0; margin:0;"&gt;
            &lt;li value="1" class="p37 p38 li2 b2" style=""&gt;&lt;span class="c1 c21"&gt;One, with a very long line to demonstrate that the hanging indent for the list is working correctly&lt;/span&gt;&lt;/li&gt;
        &lt;/ol&gt;
        &lt;ol style="padding:0; margin:0;"&gt;
            &lt;li value="2" class="p37 p38 li2 b2" style=""&gt;&lt;span class="c1 c21"&gt;Two&lt;/span&gt;&lt;/li&gt;
        &lt;/ol&gt;
        &lt;h2 class="p2" style=""&gt;&lt;span id="chapter-5-55" /&gt;Multi-level Lists&lt;/h2&gt;
        &lt;ol style="padding:0; margin:0;"&gt;
            &lt;li value="1" class="p39 p40 li2 b2" style=""&gt;&lt;span class="c1 c21"&gt;One&lt;/span&gt;&lt;/li&gt;
        &lt;/ol&gt;
        &lt;p class="p41 p42" style=""&gt;&lt;span class="c24"&gt;&lt;bdi&gt;1.1.&lt;/bdi&gt;&lt;/span&gt;&lt;span class="c1"&gt;Two&lt;/span&gt;&lt;/p&gt;
        &lt;p class="p43 p44" style=""&gt;&lt;span class="c25"&gt;&lt;bdi&gt;1.1.1.&lt;/bdi&gt;&lt;/span&gt;&lt;span class="c1"&gt;Three&lt;/span&gt;&lt;/p&gt;
        &lt;p class="p43 p44" style=""&gt;&lt;span class="c25"&gt;&lt;bdi&gt;1.1.2.&lt;/bdi&gt;&lt;/span&gt;&lt;span class="c1"&gt;Four with a very long line to demonstrate that the hanging indent for the list is working correctly.&lt;/span&gt;&lt;/p&gt;
        &lt;p class="p43 p44" style=""&gt;&lt;span class="c25"&gt;&lt;bdi&gt;1.1.3.&lt;/bdi&gt;&lt;/span&gt;&lt;span class="c1"&gt;Five&lt;/span&gt;&lt;/p&gt;
        &lt;ol style="padding:0; margin:0;"&gt;
            &lt;li value="2" class="p39 p40 li2 b2" style=""&gt;&lt;span class="c1 c21"&gt;Six&lt;/span&gt;&lt;/li&gt;
        &lt;/ol&gt;
        &lt;p class="p45 p46" style=""&gt;A Multi-level list with bullets:&lt;/p&gt;
        &lt;ol style="padding:0 0 0 1px; margin:0;"&gt;
            &lt;li class="p39 p40 li3 b3" style=""&gt;&lt;span class="c1 c23"&gt;One&lt;/span&gt;&lt;/li&gt;
        &lt;/ol&gt;
        &lt;ol style="padding:0 0 0 1px; margin:0;"&gt;
            &lt;li class="p47 p48 li1 b1" style=""&gt;&lt;span class="c1 c23"&gt;Two&lt;/span&gt;&lt;/li&gt;
        &lt;/ol&gt;
        &lt;p class="p49 p50" style=""&gt;&lt;span class="c26"&gt;&lt;img src="images/image1.gif" alt="bullet" style="vertical-align:baseline;width:1.000em;"/&gt;&lt;/span&gt;&lt;span class="c1"&gt;This bullet uses an image as the bullet item&lt;/span&gt;&lt;/p&gt;
        &lt;p class="p51 p52" style=""&gt;&lt;span class="c27"&gt;&lt;bdi&gt;o&lt;/bdi&gt;&lt;/span&gt;&lt;span class="c1"&gt;Four&lt;/span&gt;&lt;/p&gt;
        &lt;ol style="padding:0 0 0 1px; margin:0;"&gt;
            &lt;li class="p39 p40 li3 b3" style=""&gt;&lt;span class="c1 c23"&gt;Five&lt;/span&gt;&lt;/li&gt;
        &lt;/ol&gt;
        &lt;h2 class="p2" style=""&gt;&lt;span id="chapter-5-68" /&gt;Continued Lists&lt;/h2&gt;
        &lt;ol style="padding:0; margin:0;"&gt;
            &lt;li value="1" class="p53 p54 li4 b4" style=""&gt;&lt;span class="c1 c21"&gt;One&lt;/span&gt;&lt;/li&gt;
        &lt;/ol&gt;
        &lt;ol style="padding:0; margin:0;"&gt;
            &lt;li value="2" class="p53 p54 li4 b5" style=""&gt;&lt;span class="c1 c21"&gt;Two&lt;/span&gt;&lt;/li&gt;
        &lt;/ol&gt;
        &lt;p class="p55" style=""&gt;An interruption in our regularly scheduled listing, for this essential and very relevant public service announcement.&lt;/p&gt;
        &lt;ol style="padding:0; margin:0;"&gt;
            &lt;li value="3" class="p53 p54 li4 b6" style=""&gt;&lt;span class="c1 c21"&gt;We now resume our normal programming&lt;/span&gt;&lt;/li&gt;
        &lt;/ol&gt;
        &lt;ol style="padding:0; margin:0;"&gt;
            &lt;li value="4" class="p53 p54 li4 b7" style=""&gt;&lt;span class="c1 c21"&gt;Four&lt;/span&gt;&lt;/li&gt;
        &lt;/ol&gt;
        &lt;p class="p3 p56" style=""&gt; &lt;/p&gt;
    &lt;/div&gt;
&lt;/body&gt;

&lt;/html&gt;
</body>
</html>
Attached Files
File Type: epub demo_pages_4_1.epub (114.2 KB, 152 views)
Doitsu is offline   Reply With Quote