Skip to content

@jsvision/code-editor / formatInvisibleCharacterWarning

Function: formatInvisibleCharacterWarning() ​

formatInvisibleCharacterWarning(warning, i18n?): string

Defined in: code-editor/src/languages/invisibles.ts:33

Formats an invisible-character warning without changing detected source text.

Parameters ​

warning ​

InvisibleCharacterWarning

Existing detector warning.

i18n? ​

I18n

Optional locale service.

Returns ​

string

Localized warning text or the compatible safe label.

Example ​

ts
const warning = inspectInvisibleCharacters('name\u202E')[0];
const label = warning === undefined ? undefined : formatInvisibleCharacterWarning(warning);