docs: update examples (#411)

This commit is contained in:
Daniel Lautzenheiser
2023-01-23 13:20:17 -05:00
committed by GitHub
parent fcfbd6de13
commit cab7166eb7
7 changed files with 585 additions and 158 deletions

View File

@ -374,12 +374,12 @@ export function getAdditionalLink(id: string): AdditionalLink | undefined {
/**
* Markdown editor shortcodes
*/
export function registerShortcode(name: string, config: ShortcodeConfig) {
export function registerShortcode<P = {}>(name: string, config: ShortcodeConfig<P>) {
if (registry.backends[name]) {
console.error(`Shortcode [${name}] already registered. Please choose a different name.`);
return;
}
registry.shortcodes[name] = config;
registry.shortcodes[name] = config as unknown as ShortcodeConfig;
}
export function getShortcode(name: string): ShortcodeConfig {