function textContent(html) {
      // remove all tags
      var text = html.replace(tagPattern, '') // decode known entities
      text = text.replace(/&(\w{1,8}|#x?[\da-f]{1,8});/gi, function (m, code) {
        code = code.toLowerCase()
        if (code[0] === '#') {
          var value
          if (code[1] === 'x') {
            value = parseInt(code.slice(2), 16)
          } else {
            value = Number(code.slice(1))
          }
          return fromCodePoint(value)
        } else {
          var known = KNOWN_ENTITY_NAMES[code]
          if (known) {
            return known
          } // unable to decode
          return m
        }
      })
      return text
    }
Tokenize all inline templating expressions matching `placeholderPattern`.

If `replaceFilter` is provided, only matches of `placeholderPattern` for which `replaceFilter` returns
`true` will be replaced.

@param {object} env The environment of the `before-tokenize` hook.
@param {string} language The language id.
@param {RegExp} placeholderPattern The matches of this pattern will be replaced by placeholders.
@param {(match: string) => boolean} [replaceFilter]