HTML mixed mode

The HTML mixed mode depends on the XML, JavaScript, and CSS modes.

It takes an optional mode configuration option, tags, which can be used to add custom behavior for specific tags. When given, it should be an object mapping tag names (for example script) to arrays or three-element arrays. Those inner arrays indicate [attributeName, valueRegexp, modeSpec] specifications. For example, you could use ["type", /^foo$/, "foo"] to map the attribute type="foo" to the foo mode. When the first two fields are null ([null, null, "mode"]), the given mode is used for any such tag that doesn't match any of the previously given attributes. For example:

var myModeSpec = {
  name: "htmlmixed",
  tags: {
    style: [["type", /^text/(x-)?scss$/, "text/x-scss"],
            [null, null, "css"]],
    custom: [[null, null, "customMode"]]

MIME types defined: text/html (redefined, only takes effect if you load this parser after the XML parser).