UNPKG

@martin-hillford/markdown-ts-react

Version:

This is a React wrapper for the markdown-ts library. Please, see <https://github.com/martin-hillford/markdown-ts> for more information on the supported syntax.

42 lines (33 loc) 1.26 kB
# markdown-ts-react This is a React wrapper for the markdown-ts library. Please, see <https://github.com/martin-hillford/markdown-ts> for more information on the supported syntax. ## Plugins ```typescript interface IInlineParser { /** * Get's the first index for this parser matches * @param text * @return the index of where the match is happening or null when no index is matching. */ getIndex(text: string): number | null; /** * Parses the text into an annotation. However, * if text does not contain the annotation, null **should** be return * @param text The text to parse * @returns The annotation when found, else null */ parse(text: string | null | undefined): Annotation | null; } interface Annotation { /** contains the head, on this tail more parsing may be performed **/ head?: string | null | undefined /** This method should render the annotation **/ render?: (() => string) | null | undefined /** contains the tail, on this tail more parsing is performed **/ tail?: string | null | undefined /** the content - thaht's is unrendered content **/ content?: string | null | undefined }; ``` ## License Copyright Martin Hillford, available under the MIT License.