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 self-contained output compatible with Pandoc 2 #1857

Merged
merged 1 commit into from Dec 18, 2017

Conversation

jmcphers
Copy link
Member

This change makes the minimal changes necessary to make pandocSelfContainedHtml work under Pandoc 2, in the case wherein RSTUDIO_PANDOC has been set to use Pandoc 2. In particular, it adapts to the following breaking changes in Pandoc 2:

  1. The <!DOCTYPE html> header was treated as HTML and passed through, unmodified, in Pandoc 1. In Pandoc 2, it is treated as Markdown and escaped.

  2. In Pandoc 2, the HTML converter warns loudly if no title is present in the metadata.

To address these, respectively:

  1. We now use an HTML template that includes the DOCTYPE header. If the DOCTYPE header is also present in the input HTML, it is removed.

  2. We pass a dummy title metadata field into the converter. It is not used in the template, so it isn't present in the output.

These changes are also compatible with Pandoc 1, so RStudio can work with either version.

Fixes #1756.

@jmcphers jmcphers merged commit 0df3ce4 into master Dec 18, 2017
@valerie-rstudio valerie-rstudio deleted the feature/pandoc-2-compat branch January 21, 2022 17:25
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

Successfully merging this pull request may close these issues.

None yet

1 participant