Skip to content

Commit 0f7f5a5

Browse files
committed
fix #2587: convert_ipynb() no longer drops raw cells with no format in metadata
1 parent 499fa55 commit 0f7f5a5

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

NEWS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ rmarkdown 2.30
77

88
- Dropped the temporary workaround that used to support syntax highlighting of `|>` and `=>`. The workaround has no longer been necessary since [Pandoc 2.18](https://github.com/jgm/pandoc/releases/tag/2.18), which was released more than 3 years ago (#2290).
99

10+
- `convert_ipynb()` no longer drops raw cells with no `format` in metadata (thanks, @katrinabrock, #2587).
11+
1012

1113
rmarkdown 2.29
1214
================================================================================

R/jupyter.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,9 +104,9 @@ r_line_magics <- paste0('^%?(', paste(line_magics, collapse = '|'), ')($|\\s)')
104104

105105
# convert raw text/html and text/latex cells to raw ```{=format}` Markdown blocks
106106
cell_raw <- function(x, fmt) {
107-
if (length(fmt) != 1) return()
107+
if (length(fmt) != 1) return(x)
108108
fmt <- switch(fmt, 'text/html' = 'html', 'text/latex' = 'latex')
109-
if (length(fmt) == 0) return()
109+
if (length(fmt) == 0) return(x)
110110
c(sprintf('```{=%s}', fmt), x, '```')
111111
}
112112

0 commit comments

Comments
 (0)