src/utils.js
/** Sanitizes html markup that is passed in and retains video specific tags.
 * This should be used on any content that is user modifiable.
 * @param {string} markup string representation of html from untrusted source
 */
Sanitizes html markup that is passed in and retains video specific tags.
This should be used on any content that is user modifiable.
@param {string} markup string representation of html from untrusted source
Sanitizes html markup that is passed in and retains video specific tags . This should be used on any content that is user modifiable . @param { string } markup string representation of html from untrusted source
function cleanHtmlForVideo(markup) {
  return {
    __html: sanitizeHtml(markup, {
      allowedTags: sanitizeHtml.defaults.allowedTags.concat(["a", "button", "img", "source", "track", "video"]),
      allowedAttributes: {
        a: ["href"],
        img: ["src", "srcset", "alt"],
        "*": ["class", "id", "data-*"],
        video: ["controls", "width", "height", "poster", "preload"],
        source: ["src", "type"],
        track: ["kind", "src", "srclang", "label"]
      }
    }),
  };
}
function cleanHtmlForVideo ( markup ) { return { __html : sanitizeHtml ( markup , { allowedTags : sanitizeHtml . defaults . allowedTags . concat ( [ "a" , "button" , "img" , "source" , "track" , "video" ] ) , allowedAttributes : { a : [ "href" ] , img : [ "src" , "srcset" , "alt" ] , "*" : [ "class" , "id" , "data-*" ] , video : [ "controls" , "width" , "height" , "poster" , "preload" ] , source : [ "src" , "type" ] , track : [ "kind" , "src" , "srclang" , "label" ] } } ) , } ; }
Sanitizes html markup that is passed in and retains video specific tags.
Sanitizes html markup that is passed in and retains video specific tags .