@micro-app/plugin-vuepress
Version:
[Plugin] adapter vuepress plugin.
15 lines (11 loc) • 901 B
JavaScript
module.exports = md => {
const fence = md.renderer.rules.fence.bind(md.renderer.rules);
md.renderer.rules.fence = (...args) => {
const rawCode = fence(...args);
let mdStyleWrapperCode = '<div class="custom-style-wrapper window-controls">';
mdStyleWrapperCode += '<svg xmlns="http://www.w3.org/2000/svg" width="54" height="14" viewBox="0 0 54 14"><g fill="none" fill-rule="evenodd" transform="translate(1 1)"><circle cx="6" cy="6" r="6" fill="#FF5F56" stroke="#E0443E" stroke-width=".5"></circle><circle cx="26" cy="6" r="6" fill="#FFBD2E" stroke="#DEA123" stroke-width=".5"></circle><circle cx="46" cy="6" r="6" fill="#27C93F" stroke="#1AAB29" stroke-width=".5"></circle></g></svg>';
mdStyleWrapperCode += '</div>';
const finalCode = rawCode.replace('<!--afterbegin-->', `${mdStyleWrapperCode}<!--afterbegin-->`);
return finalCode;
};
};