Skip to content

Self closing <i/> tags result in all subsequent paragraphs being italic #104

@dstaley

Description

@dstaley

When a paragraph contains a self closing italic tag <i/>, the resulting kepub has all subsequent paragraphs in italic. Based on my reading of the net/html fork used, I believe this is because <i> is not one of the specific tags allowed to be self closing.

Here is a sample from an EPUB purchased from Tor Books:

<p>Lopen ended up sprawled against a boulder, upside down, ribs screaming as they knit back together with Stormlight.<i/></p>
<p>“Radiant Lopen!” Kstled said, ducking in close. “Are you all right?”</p>
<p>“Feel like a piece of snot,” Lopen said, groaning, “following a sneeze.” He peeled himself off the rock and flopped down next to Kstled. “My spear can’t get through that thing’s carapace.”</p>

And this is the resulting kepub from the same snippet:

<p><span class="koboSpan" id="kobo.11.1">Lopen ended up sprawled against a boulder, upside down, ribs screaming as they knit back together with Stormlight.</span><i></i></p><i>
<p><span class="koboSpan" id="kobo.12.1">“Radiant Lopen!” </span><span class="koboSpan" id="kobo.12.2">Kstled said, ducking in close. </span><span class="koboSpan" id="kobo.12.3">“Are you all right?”</span></p>
<p><span class="koboSpan" id="kobo.13.1">“Feel like a piece of snot,” Lopen said, groaning, “following a sneeze.” </span><span class="koboSpan" id="kobo.13.2">He peeled himself off the rock and flopped down next to Kstled. </span><span class="koboSpan" id="kobo.13.3">“My spear can’t get through that thing’s carapace.”</span></p>

The first paragraph contains an expanded empty <i></i> tag, but ends in an opening <i> tag, which results in the remainder of the chapter being rendered in italics.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions