Skip to content

Commit

Permalink
Merge pull request #5835 from nextcloud/backport/5834/stable29
Browse files Browse the repository at this point in the history
[stable29] fix(preview): prev token can be undefined in `isPreviewLinkInParagraph`
  • Loading branch information
mejo- authored May 27, 2024
2 parents b34714f + c6f0a51 commit c6cfa81
Showing 1 changed file with 1 addition and 1 deletion.
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

0 comments on commit c6cfa81

Please sign in to comment.