Skip to content

Make rest2html work with docutils 0.13

Gabriel Mazetto requested to merge docutils-0.13-support into master

Imported a PR https://github.com/github/markup/pull/976 reffered by @pravi in https://gitlab.com/gitlab-org/gitlab-markup/issues/5.

In that docutils version, HTMLTranslator.visit_image no longer appends
empty string to self.context, so trying to pop() from there raises an
IndexError.

Instead of the hard-coded pop call, call the overridden method, which will
call pop() on docutils 0.12 and will do nothing on docutils 0.13.

Also, fix the comment indentation.

cc @marin

Merge request reports