test_that("set_data() works", {
tag <- set_data(tags$a(), hello = "1")
expect_equal(tag_get_attribute(tag, "data-hello"), "1")
tag <- set_data(tag, hello = "2")
expect_equal(tag_get_attribute(tag, "data-hello"), "2")
})
test_that("add_data() works", {
tag <- add_data(tags$a(), hello = "1")
expect_equal(tag_get_attribute(tag, "data-hello"), "1")
tag <- add_data(tag, hello = "2")
expect_equal(tag_get_attribute(tag, "data-hello"), "1 2")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.