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 reader does not interpret type attribute on <ol> #2313

Closed
adunning opened this issue Jul 20, 2015 · 4 comments
Closed

HTML reader does not interpret type attribute on <ol> #2313

adunning opened this issue Jul 20, 2015 · 4 comments

Comments

@adunning
Copy link
Contributor

The HTML reader does not interpret the type attribute on <ol> (output by the HTML5 writer), as in the following case (version 1.15.0.6):

pandoc -f html -t markdown << EOT
<ol type="1">
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>
<ol type="I">
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>
<ol type="i">
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>
<ol type="A">
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>
<ol type="a">
<li>One</li>
<li>Two</li>
<li>Three</li>
</ol>
EOT

This is the result:

1.  One
2.  Two
3.  Three

<!-- -->

1.  One
2.  Two
3.  Three

<!-- -->

1.  One
2.  Two
3.  Three

<!-- -->

1.  One
2.  Two
3.  Three

<!-- -->

1.  One
2.  Two
3.  Three
@adunning
Copy link
Contributor Author

Am I missing something here? Given either of these commands:

pandoc -f markdown -t html5 << EOT | pandoc -f html -t markdown

pandoc -f markdown -t html << EOT | pandoc -f html -t markdown

I would expect the following to return identical results:

1.  One
2.  Two

<!-- -->

I.  One
II. Two

<!-- -->

i.  One
ii. Two

<!-- -->

A.  One
B.  Two

<!-- -->

a.  One
b.  Two

EOT

Instead, I receive the following in both cases:

1.  One
2.  Two

<!-- -->

1.  One
2.  Two

<!-- -->

1.  One
2.  Two

<!-- -->

1.  One
2.  Two

<!-- -->

1.  One
2.  Two

@jgm jgm closed this as completed in da0842b Jul 21, 2015
@hftf
Copy link
Contributor

hftf commented Jul 21, 2015

Oops, should have said I started fixing this bug. FYI, I think the nearby lookup "style" code (added in e814a3f from 8 years ago) doesn't work as intended:

$ cat <<EOF > foo
<ol class="lower-roman"></ol>
<ol style="lower-roman"></ol>
<ol style="list-style: lower-roman;"></ol>
<ol style="list-style-type: lower-roman;"></ol>
EOF
$ pandoc -f html -t native foo
[OrderedList (1,LowerRoman,DefaultDelim)
 []
,OrderedList (1,LowerRoman,DefaultDelim)
 []
,OrderedList (1,DefaultStyle,DefaultDelim)
 []
,OrderedList (1,DefaultStyle,DefaultDelim)
 []]

I also had trouble running the HTML tests using only cabal test. It seems I needed to completely install pandoc before my changes were used.

@jgm
Copy link
Owner

jgm commented Jul 21, 2015

Yes, the style thing is messed up. We need to look for
list-style-type. This may even be wrong in the tests
(tests/html-reader.html).

cabal test sometimes doesn't work for me either,
for reasons I don't understand. But you can always run
the test suite manually,
dist/build/test-pandoc/test-pandoc.

+++ Ophir Lifshitz [Jul 21 15 13:20 ]:

Oops, should have said I started fixing this bug. FYI, I think the
nearby lookup "style" code (added in [1]e814a3f from 8 years ago)
doesn't work as intended:
$ cat < foo

          EOF
          $ pandoc -f html -t native foo
          [OrderedList (1,LowerRoman,DefaultDelim)
          []
          ,OrderedList (1,LowerRoman,DefaultDelim)
          []
          ,OrderedList (1,DefaultStyle,DefaultDelim)
          []
          ,OrderedList (1,DefaultStyle,DefaultDelim)
          []]

          I also had trouble running the HTML tests using only cabal test. It
          seems I needed to completely install pandoc before my changes were
          used.


          Reply to this email directly or [2]view it on GitHub.

          References

          1. e814a3f#diff-b1c35a3f694e124b0b4ea092ccf36515
          2. HTML reader does not interpret type attribute on <ol> #2313 (comment)

          @jgm
          Copy link
          Owner

          jgm commented Jul 21, 2015 via email

          Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
          Labels
          None yet
          Projects
          None yet
          Development

          No branches or pull requests

          3 participants