ohayolibs
Version:
Ohayo is a set of essential modules for ohayojp.
13 lines (11 loc) • 400 B
text/typescript
const JsonML = require('jsonml.js/lib/utils');
import { getCode } from '../utils/utils';
export function highlight() {
return [
(node: any) => JsonML.isElement(node) && JsonML.getTagName(node) === 'pre',
(node: any, index: number) => {
const attr = JsonML.getAttributes(node);
return `<pre class="hljs language-${attr.lang}"><code>${getCode(node)}</code></pre>`;
},
];
}