mirror of
https://github.com/gohugoio/hugo.git
synced 2024-11-29 03:12:05 -05:00
28f621d4a7
* Move the error handling into commons and make sure the error returned also returns message errors * Make the protocol version an int so it can be more easily compared
14 lines
457 B
JavaScript
14 lines
457 B
JavaScript
import { readInput, writeOutput } from './common';
|
|
import katex from 'katex';
|
|
|
|
const render = function (input) {
|
|
const data = input.data;
|
|
const expression = data.expression;
|
|
const options = data.options;
|
|
const header = input.header;
|
|
// Any error thrown here will be caught by the common.js readInput function.
|
|
const output = katex.renderToString(expression, options);
|
|
writeOutput({ header: header, data: { output: output } });
|
|
};
|
|
|
|
readInput(render);
|