diff options
Diffstat (limited to 'src/utils')
| -rw-r--r-- | src/utils/misc.tsx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/utils/misc.tsx b/src/utils/misc.tsx index dfeb330..b646ec1 100644 --- a/src/utils/misc.tsx +++ b/src/utils/misc.tsx @@ -157,3 +157,11 @@ export function suppressErrors<F extends Function>(name: string, func: F, thisOb } }) as any as F; } + +/** + * Wrap the text in ``` with an optional language + */ +export function makeCodeblock(text: string, language?: string) { + const chars = "```"; + return `${chars}${language || ""}\n${text}\n${chars}`; +} |
