Skip to content

Commit

Permalink
fix regex expression rendering undefined when [[option]] without | is…
Browse files Browse the repository at this point in the history
… used
  • Loading branch information
blurymind committed Jan 24, 2019
1 parent 1b28c39 commit 88e44ec
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions app/js/classes/node.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ var Node = function()

/// Links in preview mode
result = result.replace(/\[\[[^\[]+\]\]/gi, function (goto) {
const extractedGoto = goto.match(/\|(.*)\]\]/i)
if (extractedGoto && extractedGoto.length > 1 )
const extractedGoto = goto.match(/\[\[(.*)\]\]/i)
if (extractedGoto && extractedGoto.length > 0 )
{
return '<font color="tomato">(go:' + extractedGoto[1] + ')</font>';
}
Expand Down

0 comments on commit 88e44ec

Please sign in to comment.