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

Make docutils alternate parsers brain dead simple #2514

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 4 additions & 1 deletion nikola/plugins/compile/rest/__init__.py
Expand Up @@ -59,6 +59,9 @@ class CompileRest(PageCompiler):
demote_headers = True
logger = None

def _rst2html(self, *p, **k):
return rst2html(*p, **k)

def compile_html_string(self, data, source_path=None, is_two_file=True):
"""Compile reST into HTML strings."""
# If errors occur, this will be added to the line number reported by
Expand All @@ -81,7 +84,7 @@ def compile_html_string(self, data, source_path=None, is_two_file=True):
'language_code': LEGAL_VALUES['DOCUTILS_LOCALES'].get(LocaleBorg().current_lang, 'en')
}

output, error_level, deps = rst2html(
output, error_level, deps = self._rst2html(
data, settings_overrides=settings_overrides, logger=self.logger, source_path=source_path, l_add_ln=add_ln, transforms=self.site.rst_transforms,
no_title_transform=self.site.config.get('NO_DOCUTILS_TITLE_TRANSFORM', False))
if not isinstance(output, unicode_str):
Expand Down