legal-markdown-js
Version:
Node.js implementation of LegalMarkdown for processing legal documents with markdown and YAML - Complete feature parity with Ruby version
22 lines • 898 B
JavaScript
import { visit } from 'unist-util-visit';
export const remarkDebugAST = () => {
return (tree) => {
console.log('\n=== AST DEBUG ===');
let nodeCount = 0;
visit(tree, (node, index, parent) => {
if (node.type === 'text' || node.type === 'html') {
const value = node.value || '';
if (value.includes('{{#') || value.includes('{{/')) {
console.log(`\nNode #${nodeCount} (${node.type}):`);
console.log('Value:', JSON.stringify(value));
console.log('Parent type:', parent?.type);
console.log('Full value length:', value.length);
}
}
nodeCount++;
});
console.log(`\nTotal nodes visited: ${nodeCount}`);
console.log('=== END AST DEBUG ===\n');
};
};
//# sourceMappingURL=debug-ast.js.map