Variable ChevronsConst

Chevrons: {
    closingTag: string;
    name: string;
    openingTag: string;
    tagEndPattern: RegExp;
    tagPattern: RegExp;
    tagStartPattern: RegExp;
} = ...

Options for replacing tags using angle brackets (<< >>). Matches tags of the form <<variable>> in the text.

Type declaration

  • closingTag: string

    The closing tag.

    Example

    "}}"
    
  • name: string
  • openingTag: string

    The opening tag.

    Example

    "{{"
    
  • tagEndPattern: RegExp

    The regular expression pattern for matching the end of a tag.

    Example

    /\s*}}/g.
    
  • tagPattern: RegExp

    The regular expression pattern for matching tags.

    Example

    /{{\s*?.*?\s*}}/g
    
  • tagStartPattern: RegExp

    The regular expression pattern for matching the start of a tag.

    Example

    /{{\s*?/g.
    

Example

// Example usage:
const text = 'Hello <<variable>>';
const result = replaceTags(text, { variable: 'world' }, Chevrons);
console.log(result); // Output: 'Hello world'

Generated using TypeDoc