2.3 Adding new tags

  • Create a custom tag via the tag() function:

    customTag <- tag(
      "test",
      list(
        class = "custom",
        p("Custom tag's only child")
      )
    )
    customTag
    <test class="custom">
      <p>Custom tag's only child</p>
    </test>
  • Validate if the custom tag follows the HTML standards.