Skip to content

Commit

Permalink
Remove newlines in NavPoint
Browse files Browse the repository at this point in the history
Some epub have newline in the middle of their TOC
Reported in seblucas/cops#365
  • Loading branch information
seblucas committed Jan 5, 2018
1 parent 39620b9 commit 6b4f19e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/EPub.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ private function getNavPointDetail($node)
$title = $this->toc_xpath->query('x:navLabel/x:text', $node)->item(0)->nodeValue;
$src = $this->toc_xpath->query('x:content', $node)->item(0)->attr('src');
$src = $this->encodeComponentName ($src);
return array('title' => $title, 'src' => $src);
return array('title' => preg_replace('~[\r\n]+~', '', $title), 'src' => $src);
}

/**
Expand Down

0 comments on commit 6b4f19e

Please sign in to comment.