Skip to content

Commit

Permalink
Use a different marker (<>) for glue 2nd round
Browse files Browse the repository at this point in the history
To make it clear in the code that we are doing the
second round.
  • Loading branch information
gaborcsardi committed Aug 18, 2022
1 parent e68b069 commit ba2bade
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions R/containers.R
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,9 @@ clii__item_text <- function(app, type, name, cnt_id, text, .list) {
res
} else if (type == "dl") {
mrk <- text$values$marker
text$str <- paste0("{", mrk, ".dd ", text$str, mrk, "}")
text$str <- paste0("<", mrk, ".dd ", text$str, mrk, ">")
mrk2 <- head$values$marker
paste0("{", mrk2, ".dt ", head$str, mrk2, "}")
paste0("<", mrk2, ".dt ", head$str, mrk2, ">")
}

app$xtext(
Expand Down
14 changes: 7 additions & 7 deletions R/inline.R
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ inline_transformer <- function(code, envir) {
# but only to the whole non-brace expression. We don't need to end this
# container, because the one above (`id`) will end this one as well.

braceexp <- grepl("^[{][^.][^}]*[}]$", text)
braceexp <- grepl("^[<][^.][^}]*[>]$", text)
if (!braceexp) {
id2 <- clii__container_start(app, "span", class = NULL)
}
Expand All @@ -137,8 +137,8 @@ inline_transformer <- function(code, envir) {
text,
.envir = envir,
.transformer = inline_transformer,
.open = paste0("{", envir$marker),
.close = paste0(envir$marker, "}")
.open = paste0("<", envir$marker),
.close = paste0(envir$marker, ">")
)

# If we don't have a brace expression, then (non-inherited) styling was
Expand Down Expand Up @@ -216,8 +216,8 @@ clii__inline <- function(app, text, .list) {
t$str,
.envir = t$values,
.transformer = inline_transformer,
.open = paste0("{", t$values$marker),
.close = paste0(t$values$marker, "}")
.open = paste0("<", t$values$marker),
.close = paste0(t$values$marker, ">")
)
})
paste(out, collapse = "")
Expand Down Expand Up @@ -245,7 +245,7 @@ make_cmd_transformer <- function(values) {
values[[id]] <- res
values$qty <- res
values$num_subst <- values$num_subst + 1L
return(paste0("{", values$marker, id, values$marker, "}"))
return(paste0("<", values$marker, id, values$marker, ">"))
}

# plurals
Expand All @@ -269,7 +269,7 @@ make_cmd_transformer <- function(values) {
.envir = envir,
.transformer = sys.function()
)
paste0("{", values$marker, ".", funname, " ", out, values$marker, "}")
paste0("<", values$marker, ".", funname, " ", out, values$marker, ">")
}
}
}
Expand Down

0 comments on commit ba2bade

Please sign in to comment.