You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Within a particular paragraph, if there are exactly two links and one is a bookmark (not a normal link), the table of contents logic within Library can crash.
Expected Behavior
When a paragraph does not match expectations for table of contents, the link replacement should be ignored and left as-is.
To Reproduce
Within a single paragraph, add a bookmark. Then add a normal link later in the paragraph. Reload the library page and observe the following trace:
TypeError: Cannot read property \'match\' of undefined
at checkForTableOfContents (/usr/src/app/server/formatter.js:156:25)
at Node.$p.each (/usr/src/app/server/formatter.js:26:31)
at initialize.exports.each (/usr/src/app/node_modules/cheerio/lib/api/traversing.js:300:24)
at normalizeHtml (/usr/src/app/server/formatter.js:22:6)
at getProcessedHtml (/usr/src/app/server/formatter.js:231:14)
at Object.exports.getProcessedDocAttributes (/usr/src/app/server/formatter.js:243:25)
at exports.fetchDoc
Possible Solution
The table of contents logic should be made more robust, so that link tags without href attributes are ignored.
The text was updated successfully, but these errors were encountered:
Context (Environment)
Within a particular paragraph, if there are exactly two links and one is a bookmark (not a normal link), the table of contents logic within Library can crash.
Expected Behavior
When a paragraph does not match expectations for table of contents, the link replacement should be ignored and left as-is.
To Reproduce
Within a single paragraph, add a bookmark. Then add a normal link later in the paragraph. Reload the library page and observe the following trace:
Possible Solution
The table of contents logic should be made more robust, so that link tags without
href
attributes are ignored.The text was updated successfully, but these errors were encountered: