javascript 100ms 44.5MB with comments that works for "&amp;gt;"
Best version that works for &amp;gt; simply by putting all patterns into a single regex first so only 1 pass for every match. This way it doesn\'t use already d
Best version that works for `&amp;gt;` simply by putting all patterns into a single regex first so only 1 pass for every match. This way it doesn\'t use already decoded chars as pre-decoded chars for matching.\n\n```js\n// create conversion table\nconst table = {\n  \'&quot;\'  :   `"`,\n  \'&apos;\'  :   `\'`,\n  \'&amp;\'   :   `&`,\n  \'&gt;\'    :   `>`,\n  \'&lt;\'    :   `<`,\n  \'&frasl;\' :   `/`\n}\n\n// grab keys of it for array of just keys\n// convert to regex of pattern OR pattern OR pattern ...\nconst pattern =  Object.keys(table).reduce((res, thisPattern) => `${res}|${thisPattern}`)\n\n// return w/ replaced matches after 1 pass\nconst entityParser = text => text.replace(new RegExp(pattern, \'g\'), match => table[match])\n```\n\n\ntechnically wrong version that worked for all used test cases but would convert `&amp;gt;` to `&gt;` and then again to `>` by wrongly treating decoded `&` as encoded `&`\n\n```js\n// create conversion table from what to what\nconst table = {\n  [`&quot;`]: `"`,\n  [`&apos;`]: `\'`,\n  [`&amp;`]: `&`,\n  [`&gt;`]: `>`,\n  [`&lt;`]: `<`,\n  [`&frasl;`]: `/`\n}\n\n// grab keys of it for array of just keys to iterate through\nconst lookups = Object.keys(table)\n\nconst entityParser = text => {\n  for (let i = 0; i < lookups.length; i++) {\n    // replace all only via regex with g, no characters to escape so easy\n    // split/join works but might take too long for long strings\n    text = text.replace(new RegExp(lookups[i], \'g\'), table[lookups[i]])\n  }\n  return text\n}\n```\n
['JavaScript']