const unescapeHTML = (str: string) =>
        str.replace(
          /&|<|>|'|"/g,
          tag =>
            ({
              '&': '&',
              '&lt;': '<',
              '&gt;': '>',
              '&#39;': "'",
              '&quot;': '"'
            }[tag] || tag)
        );
      
      Typescript language logo

      Unescape HTML

      0

      0

      avatar
      Giovanny Gongora
      Codiga's TypeScript Recipes

      Unescapes escaped HTML characters.

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.