legal-markdown-js
Version:
Node.js implementation of LegalMarkdown for processing legal documents with markdown and YAML - Complete feature parity with Ruby version
62 lines • 1.85 kB
TypeScript
/**
* Remark plugin for signature lines
*
* Detects long sequences of underscores (10 or more consecutive) and wraps them
* in HTML spans with a CSS class for styling. This is commonly used in legal
* documents to indicate signature lines.
*
* @example
* Input: "Signature: __________________________"
* Output: "Signature: <span class=\"signature-line\">__________________________</span>"
*
* @module plugins/remark/signature-lines
*/
import type { Plugin } from 'unified';
import type { Root } from 'mdast';
/**
* Options for the signature lines plugin
*/
export interface SignatureLinesOptions {
/**
* Minimum number of consecutive underscores to treat as a signature line
* @default 10
*/
minUnderscores?: number;
/**
* Whether to add CSS class to signature lines
* @default true
*/
addCssClass?: boolean;
/**
* Custom CSS class name for signature lines
* @default "signature-line"
*/
cssClassName?: string;
/**
* Whether to enable debug logging
* @default false
*/
debug?: boolean;
}
/**
* Remark plugin that detects and marks signature lines
*
* This plugin processes text nodes in the markdown AST and identifies sequences
* of underscores that are likely signature lines (by default, 10 or more consecutive
* underscores). When found, it wraps them in HTML span elements with a CSS class
* for styling.
*
* @param options - Configuration options for the plugin
* @returns A unified transformer function
*
* @example
* ```typescript
* unified()
* .use(remarkParse)
* .use(remarkSignatureLines, { minUnderscores: 15 })
* .use(remarkStringify)
* ```
*/
declare const remarkSignatureLines: Plugin<[SignatureLinesOptions?], Root>;
export default remarkSignatureLines;
//# sourceMappingURL=signature-lines.d.ts.map