Skip to content

Make self-contained output compatible with Pandoc 2 - #1857

Merged
jmcphers merged 1 commit into
masterfrom
feature/pandoc-2-compat
Dec 18, 2017
Merged

jmcphers merged 1 commit into
masterfrom
feature/pandoc-2-compat

Conversation

@jmcphers

Copy link
Copy Markdown
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.

1 participant