Markdown processor for the localize.sh ecosystem. This package parses Markdown files into a localization-friendly AST (Abstract Syntax Tree) and stringifies them back, preserving structure while allowing content extraction.
npm install @localizesh/processor-mdimport MdProcessor from "@localizesh/processor-md";
const processor = new MdProcessor();
const mdContent = '# Hello world';
// Parse into a Document (AST + Segments)
const document = processor.parse(mdContent);
// ... modify document segments ...
// Stringify back to Markdown
const newMdContent = processor.stringify(document);This package provides a binary localize-processor-md that works with standard I/O. It reads a protobuf ParseRequest or StringifyRequest from stdin and writes a ParseResponse or StringifyResponse to stdout, making it compatible with the localize.sh plugin system.
- Structure Preservation: Maintains the original structure of the Markdown document.
- Round-trip: Ensures that parsing and then stringifying results in the original Markdown structure, preserving as much formatting as possible.
npm run buildnpm test