From 27f402523f8f5ad36a4ac436557f8f76cef4b637 Mon Sep 17 00:00:00 2001 From: Matthew Kay Date: Thu, 21 Dec 2023 00:36:35 -0600 Subject: [PATCH] prevent asis_restore from adding AsIs multiple times --- R/type-asis.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/R/type-asis.R b/R/type-asis.R index b838b5e31..06f905490 100644 --- a/R/type-asis.R +++ b/R/type-asis.R @@ -115,6 +115,6 @@ asis_strip <- function(x) { asis_restore <- function(x) { # Using `oldClass()` here to return `NULL` for atomics # so that their implicit class isn't added - class(x) <- c("AsIs", oldClass(x)) + class(x) <- unique.default(c("AsIs", oldClass(x))) x }