Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR improves styles for code blocks.
html_document2 / html_chapter / html_book
This part is related to #733 and #706.
When Pandoc's syntax highlighting is enabled and
clean_highlight_tags: TRUE
, Pandoc embeds CSS and cause code blocks to have no margins. Exceptionally, the matter does not happen whenhighlight: default
inhtml_document2
For the
html_document2
, Pandoc embeds CSS starting from<style type="text/css" data-origin="pandoc">
.Thus, I decided to remove unwanted styles by updating
clean_pandoc2_tags
.For the others, Pandoc embeds CSS starting from
<style type="text/css">
, which cannot be telled if the CSS is added by Pandoc or the user.Thus, I decided to add CSS to template (
default.html
) to override the one embedded by Pandoc.I also updated CSS in the similar way as rstudio/rmarkdown#1596, so that output code blocks have white background when line numbering is enabled.
Before
After
html_gitbook
When line nubering is enabled for code blocks, they are positioned too left, and may overflow.
Thus I updated
html_gitbook
's template.Before
After
Source code for examples above
The above output is rendered from the source code below with