fix: export parseInlineElements and types from markdown.ts
This commit is contained in:
@@ -3,13 +3,13 @@
|
|||||||
* Supports: bold, italic, code blocks, inline code, links, lists, tables, headings, line breaks
|
* Supports: bold, italic, code blocks, inline code, links, lists, tables, headings, line breaks
|
||||||
*/
|
*/
|
||||||
|
|
||||||
interface InlineSegment {
|
export interface InlineSegment {
|
||||||
type: 'text' | 'bold' | 'italic' | 'code' | 'link';
|
type: 'text' | 'bold' | 'italic' | 'code' | 'link';
|
||||||
content: string;
|
content: string;
|
||||||
href?: string;
|
href?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
interface ParsedSegment {
|
export interface ParsedSegment {
|
||||||
type: 'text' | 'bold' | 'italic' | 'code' | 'codeBlock' | 'link' | 'list' | 'table' | 'lineBreak' | 'heading';
|
type: 'text' | 'bold' | 'italic' | 'code' | 'codeBlock' | 'link' | 'list' | 'table' | 'lineBreak' | 'heading';
|
||||||
content: string;
|
content: string;
|
||||||
items?: string[];
|
items?: string[];
|
||||||
@@ -106,7 +106,7 @@ function parseTableRow(row: string): InlineSegment[][] {
|
|||||||
.map(cell => parseInlineElements(cell));
|
.map(cell => parseInlineElements(cell));
|
||||||
}
|
}
|
||||||
|
|
||||||
function parseInlineElements(text: string): InlineSegment[] {
|
export function parseInlineElements(text: string): InlineSegment[] {
|
||||||
const segments: InlineSegment[] = [];
|
const segments: InlineSegment[] = [];
|
||||||
|
|
||||||
const inlineRegex = /(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`|\[.*?\]\(.*?\))/g;
|
const inlineRegex = /(\*\*[^*]+\*\*|\*[^*]+\*|`[^`]+`|\[.*?\]\(.*?\))/g;
|
||||||
|
|||||||
Reference in New Issue
Block a user