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

Error when html constains <ol start=''> #5162

Closed
coldfog opened this issue Dec 17, 2018 · 1 comment
Closed

Error when html constains <ol start=''> #5162

coldfog opened this issue Dec 17, 2018 · 1 comment

Comments

@coldfog
Copy link

coldfog commented Dec 17, 2018

pandoc version:

pandoc 2.5
Compiled with pandoc-types 1.17.5.4, texmath 0.11.1.2, skylighting 0.7.4

OS: Windows 7 x64
Command line:pandoc test.html -o test.pdf

input file test.html:

<ol start=''><li></li></ol>

command report: pandoc: Prelude.read: no parse

if change the attribute start to start='1' or delete <li></li>, it will work fine.

@jgm
Copy link
Owner

jgm commented Dec 17, 2018

We should replace all uses of read with safeRead:

  • src/Text/Pandoc/Parsing.hs 739: return (Decimal, read num)

  • src/Text/Pandoc/Readers/Docx/Lists.hs 49:getLevel (Div (_, _, kvs) _) = read <$> lookup "level" kvs 56:getNumId (Div (_, _, kvs) _) = read <$> lookup "num-id" kvs 92: read (fromMaybe "1" start) :: Int,

  • src/Text/Pandoc/Readers/HTML.hs 323: then read sta

  • src/Text/Pandoc/Readers/Odt/StyleReader.hs 581: then read v

  • src/Text/Pandoc/Readers/Org/Meta.hs 268: placeholder = try . fmap read $ char '$' *> many1 digit

jgm added a commit that referenced this issue Dec 17, 2018
@jgm jgm closed this as completed in 404e967 Dec 17, 2018
@jgm jgm reopened this Dec 26, 2018
@jgm jgm closed this as completed Dec 26, 2018
daamien pushed a commit to daamien/pandoc that referenced this issue Dec 27, 2018
daamien pushed a commit to daamien/pandoc that referenced this issue Dec 27, 2018
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

2 participants