Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

HTML Table colspan not support when converting to EPUB #1340

Closed
rgaiacs opened this issue Jun 14, 2014 · 2 comments
Closed

HTML Table colspan not support when converting to EPUB #1340

rgaiacs opened this issue Jun 14, 2014 · 2 comments

Comments

@rgaiacs
Copy link
Contributor

rgaiacs commented Jun 14, 2014

Consider the follow example (named sample.html):

<!DOCTYPE html>
<html>

<body>
    <h1>Title</h1>
    <table border="1">
        <tr>
            <td>X</td>
            <td colspan="2" align="center">Y</td>
        </tr>
        <tr>
            <td>1</td>
            <td>2</td>
            <td>3</td>
        </tr>
        <tr>
            <td>4</td>
            <td>5</td>
            <td>6</td>
        </tr>
    </table>
</body>

</html>

I want to convert it into EPUB and for it I use

$ pandoc -f html -t epub -o sample.epub sample.html

The EPUB is create but every cell of the table became one paragraph:

$ unzip -c sample.epub ch001.xhtml                
Archive:  sample.epub
  inflating: ch001.xhtml             
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <meta http-equiv="Content-Style-Type" content="text/css" />
  <meta name="generator" content="pandoc" />
  <title>Title</title>
  <link rel="stylesheet" type="text/css" href="stylesheet.css" />
</head>
<body>
<div id="title" class="section level1"><h1>Title</h1><p>X</p><p>Y</p><p>1</p><p>2</p><p>3</p><p>4</p><p>5</p><p>6</p></div>
</body>
</html>

Environment Configuration

$ pandoc --version
pandoc 1.12.5
Compiled with texmath 0.6.6.3, highlighting-kate 0.5.8.2.
@jgm
Copy link
Owner

jgm commented Jun 16, 2014

The pandoc table model does not currently support colspans or rowspans. So these tables cannot be parsed.

You could try with --parse-raw -- the HTML tags in the table should then be transmitted verbatim.

@jgm
Copy link
Owner

jgm commented Dec 9, 2016

closing in favor of #1024

@jgm jgm closed this as completed Dec 9, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants