Skip to content

Instantly share code, notes, and snippets.

@meirkl
Created October 19, 2020 11:55
Show Gist options
  • Select an option

  • Save meirkl/19d545d9025196741e260c75ad9c4632 to your computer and use it in GitHub Desktop.

Select an option

Save meirkl/19d545d9025196741e260c75ad9c4632 to your computer and use it in GitHub Desktop.

Revisions

  1. meirkl created this gist Oct 19, 2020.
    13 changes: 13 additions & 0 deletions decodeHTML.ts
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,13 @@
    /**
    *
    * @param html encoded html
    * example:
    * <p>In this course, you’ll learn:</p>
    * wiill get decoded to:
    * <p>In this course, you'll learn:</p>
    */
    function decode(html: string) {
    var txt = document.createElement('textarea');
    txt.innerHTML = html;
    return txt.value;
    }