Skip to main content

Function: codeBlock()

Call Signature

codeBlock<C>(content: C): ```` ${C} ````

Defined in: codeBlock.ts:14

Wraps the content inside a codeblock with no language

Type Parameters

Type Parameter
C extends string

Parameters

ParameterTypeDescription
contentCThe content to wrap

Returns

```` ${C} ````

Remark

If the provided content includes 3 backticks (```) then those backticks will be escaped by adding a Zero Width Space between the first and second backtick

Remark

If the provided content ends with a backtick then a Zero Width Space will be added to the end of the content

Call Signature

codeBlock<L, C>(language: L, content: C): ````${L} ${C} ````

Defined in: codeBlock.ts:28

Wraps the content inside a codeblock with the specified language

Type Parameters

Type Parameter
L extends string
C extends string

Parameters

ParameterTypeDescription
languageLThe codeblock language
contentCThe expression to be wrapped in the codeblock

Returns

````${L} ${C} ````

Remark

If the provided content includes 3 backticks (```) then those backticks will be escaped by adding a Zero Width Space between the first and second backtick

Remark

If the provided content ends with a backtick then a Zero Width Space will be added to the end of the content