@readme/markdown 13.1.1 → 13.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,25 @@
1
+ export interface BlockHit {
2
+ key: string;
3
+ raw: string;
4
+ token: string;
5
+ }
6
+ /**
7
+ * The content matching in this regex captures everything between `[block:TYPE]`
8
+ * and `[/block]`, including new lines. Negative lookahead for the closing
9
+ * `[/block]` tag is required to prevent greedy matching to ensure it stops at
10
+ * the first closing tag it encounters preventing vulnerability to polynomial
11
+ * backtracking issues.
12
+ */
13
+ export declare const MAGIC_BLOCK_REGEX: RegExp;
14
+ /**
15
+ * Extract legacy magic block syntax from a markdown string.
16
+ * Returns the modified markdown and an array of extracted blocks.
17
+ */
18
+ export declare function extractMagicBlocks(markdown: string): {
19
+ replaced: string;
20
+ blocks: BlockHit[];
21
+ };
22
+ /**
23
+ * Restore extracted magic blocks back into a markdown string.
24
+ */
25
+ export declare function restoreMagicBlocks(replaced: string, blocks: BlockHit[]): string;