Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
fix(preview): prev token can be undefined in isPreviewLinkInParagraph
Fixes: nextcloud/collectives#1231

Signed-off-by: Jonas <[email protected]>
  • Loading branch information
mejo- authored and backportbot[bot] committed May 27, 2024
commit c6f0a510313767ff01eed96085e7790d1715374a
2 changes: 1 addition & 1 deletion src/markdownit/preview.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
*/
function isPreviewLinkInParagraph(tokens, i) {
const [prev, cur, next] = tokens.slice(i - 1, i + 2)
return prev.type === 'paragraph_open'
return prev?.type === 'paragraph_open'
&& cur.type === 'inline'
&& cur.children
&& cur.children.length === 3
Expand Down