mirror of
https://github.com/FlipsideCrypto/DefinitelyTyped.git
synced 2026-02-06 19:07:08 +00:00
🤖 Merge PR #46999 markdown-to-jsx: add definition for namedCodesToUnicode and disableParsingRawHTML by @lkuechler
This commit is contained in:
parent
0065970ce9
commit
0ea9a3ec80
7
types/markdown-to-jsx/index.d.ts
vendored
7
types/markdown-to-jsx/index.d.ts
vendored
@ -2,6 +2,7 @@
|
||||
// Project: https://probablyup.github.io/markdown-to-jsx
|
||||
// Definitions by: Elizabeth Craig <https://github.com/ecraig12345>
|
||||
// Sun Knudsen <https://github.com/sunknudsen>
|
||||
// Lasse Kuechler <https://github.com/lkuechler>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
// TypeScript Version: 2.8
|
||||
|
||||
@ -80,6 +81,12 @@ export interface MarkdownOptions {
|
||||
|
||||
/** Custom function to generate an HTML id from headings. */
|
||||
slugify?: (text: string) => string;
|
||||
|
||||
/** Override named html codes that should be converted to unicode characters. */
|
||||
namedCodesToUnicode?: Record<string, string>;
|
||||
|
||||
/** By default, raw HTML is parsed to JSX. This behavior can be disabled with this option. */
|
||||
disableParsingRawHTML?: boolean;
|
||||
}
|
||||
|
||||
export function compiler(markdown: string, options?: MarkdownOptions): JSX.Element;
|
||||
|
||||
@ -145,3 +145,18 @@ render(
|
||||
# Header 1
|
||||
## Header 2
|
||||
`}</Markdown>;
|
||||
|
||||
<Markdown
|
||||
options={{
|
||||
namedCodesToUnicode: {
|
||||
le: '\u2264',
|
||||
ge: '\u2265',
|
||||
},
|
||||
}}
|
||||
>
|
||||
This text is ≤ than this text.
|
||||
</Markdown>;
|
||||
|
||||
<Markdown options={{ disableParsingRawHTML: true }}>
|
||||
{"This text has <span>html</span> in it but it won't be rendered"}
|
||||
</Markdown>;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user