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

RST reader produces headers below top level #3750

Closed
link2xt opened this issue Jun 20, 2017 · 4 comments
Closed

RST reader produces headers below top level #3750

link2xt opened this issue Jun 20, 2017 · 4 comments

Comments

@link2xt
Copy link
Collaborator

link2xt commented Jun 20, 2017

The bug is similar to the one fixed in Muse reader in PR #3749

As a result, conversion to FB2 may produce an "unexpected header in section text":

pandoc -f rst -t fb2 <<EOF
 - a

   b
   ---
EOF
@jgm
Copy link
Owner

jgm commented Jun 20, 2017

Not sure about this. docutils' rst2html.py will simply abort on this input with a severe error. We don't do that; pandoc's general approach is not to exit with an error (though we might rethink that).

Since this is invalid RST anyway, is it terrible if pandoc interprets it as having a header inside a list item?

I can see more reason to be concerned about pandoc's RST writer, if it produces this.

@link2xt
Copy link
Collaborator Author

link2xt commented Jun 20, 2017

pandoc's general approach is not to exit with an error (though we might rethink that).

Well, in my example pandoc exits with an error because FB2 writer does not expect headers inside a list

I have not checked with rst2html. If it is invalid RST then ok, I just though it may be better to just parse --- as something else, like text "b ---", or abort with an error. Header inside a list item just does not make sense.

@jgm jgm closed this as completed in b26d3c4 Jun 20, 2017
jgm added a commit that referenced this issue Jun 20, 2017
… header.

This only applies to section headers inside list items, e.g.,
which were otherwise silently omitted.

See #3750.
@jgm
Copy link
Owner

jgm commented Jun 20, 2017

OK, it's really more an issue with the FB2 writer then, since in some formats you certainly can have headers inside lists. I've changed the writer so it handles this more gracefully.

@link2xt
Copy link
Collaborator Author

link2xt commented Jun 20, 2017

Ok, I tested it, now it outputs [info] Not rendering Header 1 ("b",[],[]) [Str "b"] if --verbose is used.

With Muse reader it is a bug in Muse reader, through.

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

2 participants