UNPKG

@rstacruz/gatsby-remark-component

Version:

When you use a React component in your markdown, it will insert it as a div instead of a p

3 lines (2 loc) 1.38 kB
!function(t){"function"==typeof define&&define.amd?define(t):t()}(function(){var t=["a","abbr","address","area","article","aside","audio","b","base","bdi","bdo","blockquote","body","br","button","canvas","caption","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","div","dl","dt","em","embed","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","u","ul","var","video","wbr"],e=require("unist-util-visit");module.exports=function(i,o){var a=i.markdownAST,n=o.components;n&&0!=n.length?n.length>0&&function(t,i){i.forEach(function(i){e(t,"html",function(t,e,o){t.value=="<"+i+">"&&(o.type="div")})})}(a,n):function(i){e(i,"html",function(e,i,o){t.some(function(t){return e.value=="<"+t+">"||e.value.startsWith("<"+t+" ")})||(o.type="div")})}(a)}}); //# sourceMappingURL=gatsby-remark-component.umd.js.map