// NOTE: this code is a modified copy of codeBlockCopyButtons.js
import cheerio from 'cheerio';
import { MbNode } from '../utils/node.js';
import {
CONTAINER_HTML,
isFunctionBtnContainer,
doesFunctionBtnContainerExistInNode,
} from './codeBlockButtonsAssets/codeBlockButtonsContainer.js';
import type { PluginContext } from './Plugin.js';
const CSS_FILE_NAME = 'codeBlockButtonsAssets/codeBlockButtons.css';
const WRAP_ICON = `
`;
const WRAP_MESSAGE = 'Wrap Text';
const UNWRAP_MESSAGE = 'Unwrap Text';
function getButtonHTML() {
const html = ``;
return html;
}
const wrapCodeBlockScript = ``;
const getLinks = () => [``];
const getScripts = () => [wrapCodeBlockScript];
const processNode = (_: PluginContext, node: MbNode) => {
if (node.name === 'pre' && node.children?.some(child => child.name === 'code')) {
if (!doesFunctionBtnContainerExistInNode(node)) {
cheerio(node).append(CONTAINER_HTML);
}
} else if (isFunctionBtnContainer(node)) {
cheerio(node).append(getButtonHTML());
}
};
export {
getLinks,
processNode,
getScripts,
};