Skip to content

data oninclude

Sid Vishnoi edited this page Jul 8, 2020 · 8 revisions


Configuration options

W3C Configuration options

Linter rules

Internal properties

Handled by ReSpec for you.

Special <section> IDs

HTML elements

Custom Elements


HTML attributes

CSS Classes

Special properties

Clone this wiki locally


This is a list of white space separated JavaScript function names that will be called in turn in order to transform the content inside the given element. The functions need to be globally available.

Each function gets called with three arguments:

  • ReSpec utils object.
  • a string of the content to transform.
  • the URL of the loaded content.

Each function must return the transformed content.

  // Adds rainbows where appropriate.
  function toRainbows(utils, content, url) {
    return content.replace(/rainbow/gi, "🌈");

  // Replaces unicorns rainbows where appropriate.
  function replaceUnicorns(utils, content, url) {
    return content.replace("🦄", "🐴");

<!-- Include content.fragment file, but then process it on include. -->
  data-oninclude="toRainbows replaceUnicorns"