Skip to content

Commit

Permalink
a temporary workaround for davidgohel/flextable#621
Browse files Browse the repository at this point in the history
  • Loading branch information
yihui committed Apr 4, 2024
1 parent 4ce8111 commit 12ba5b4
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -1054,6 +1054,11 @@ raw_block = function(x, type = 'latex', ...) {
if (!rmarkdown::pandoc_available('2.0.0')) warning('raw_block() requires Pandoc >= 2.0.0')
x = fenced_block(x, attr = paste0('=', type))
x = gsub('^\n|\n$', '', x)
# TODO: get rid of this hack for davidgohel/flextable#621
if ('flextable' %in% xfun:::sys.packages() && packageVersion('flextable') <= '0.9.5') {
x = gsub('^(\\s*)```+', '\\1```', x)
x = gsub('```+(\\s*)$', '```\\1', x)
}
asis_output(x, ...)
}

Expand Down

0 comments on commit 12ba5b4

Please sign in to comment.