Function removeHTML

  • Remove HTML tags from a string, and optionally newline characters.

    Usage:

    const ret = removeHTML('<div>hello world</div>');
    console.log(ret);

    Output:

    hello world
    

    Parameters

    • str: string

      带 HTML 标签的字符串

    • options: {
          removeNewLine?: boolean;
      } = {}
      • Optional removeNewLine?: boolean

    Returns string

    字符串