Skip to content

Commit

Permalink
Merge pull request #74 from jhudsl/cansavvy/image-fixes
Browse files Browse the repository at this point in the history
Get rid of pesky comma on image specs
  • Loading branch information
cansavvy authored Sep 28, 2021
2 parents b27c4d1 + beb7e57 commit 969d347
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion R/replace_html.R
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ build_image <- function(src, ..., caption = NULL, embed = NULL,
'align: "{align}",',
'type: "{type}",',
'poster: "{poster}",',
'embed: "{embed}"'
'embed: "{embed}",'
)
if (is.null(fullbleed) ||
length(fullbleed) == 0 ||
Expand All @@ -273,6 +273,8 @@ build_image <- function(src, ..., caption = NULL, embed = NULL,
# Make sure it's coerced as a character
specs <- unlist(sapply(specs, as.character))

specs <- gsub(",\\}$", "}", specs)

# Set as fullbleed if TRUE
specs <- c(specs, if (fullbleed) "fullbleed: true")

Expand Down

0 comments on commit 969d347

Please sign in to comment.