# All files / src/lib/markdown-it/plugins/markdown-it-block-embed index.js

100% Statements 7/7
100% Branches 0/0
100% Functions 1/1
100% Lines 7/7

Press n or j to go to the next uncovered block, b, p or k for the previous block.

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22

    17x
    17x
    17x

    30x

    30x

    30x

    17x
     // Copyright (c) Rotorz Limited and portions by original markdown-it-video authors
    // Licensed under the MIT license. See LICENSE file in the project root.

    "use strict";

    const PluginEnvironment = require("./PluginEnvironment");
    const renderer = require("./renderer");
    const tokenizer = require("./tokenizer");

    function setup(md, options) {
      let env = new PluginEnvironment(md, options);

      md.block.ruler.before("fence", "video", tokenizer.bind(env), {
        alt: [ "paragraph", "reference", "blockquote", "list" ]
      });
      md.renderer.rules["video"] = renderer.bind(env);
    }

    module.exports = setup;