Files
http.md/src/execution/handlers/handlers.text.ts
Morten Olsen bc92c91ff8 init
2025-05-18 20:01:34 +02:00

22 lines
461 B
TypeScript

import { type ExecutionHandler } from '../execution.js';
import Handlebars from "handlebars";
const textHandler: ExecutionHandler = ({
addStep,
node,
}) => {
if (node.type === 'text') {
addStep({
type: 'parse-text',
node,
action: async ({ context }) => {
const template = Handlebars.compile(node.value);
const content = template(context);
node.value = content;
},
})
}
}
export { textHandler };