diff --git a/CHANGELOG.md b/CHANGELOG.md index 4c36e4d..271622b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [12.0.3] - WIP ### Fixed - `[]()` is no longer a valid link. +- Fix performance issues when parsing links, #732. ## [12.0.2] - 2020-10-23 diff --git a/lib/helpers/parse_link_destination.js b/lib/helpers/parse_link_destination.js index f85b4f6..6c1423c 100644 --- a/lib/helpers/parse_link_destination.js +++ b/lib/helpers/parse_link_destination.js @@ -59,6 +59,7 @@ module.exports = function parseLinkDestination(str, pos, max) { if (code === 0x28 /* ( */) { level++; + if (level > 32) { return result; } } if (code === 0x29 /* ) */) {