diff options
Diffstat (limited to 'vendor')
-rw-r--r-- | vendor/ssb-mentions.js | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/vendor/ssb-mentions.js b/vendor/ssb-mentions.js index b01bf9a..37e7678 100644 --- a/vendor/ssb-mentions.js +++ b/vendor/ssb-mentions.js @@ -2,6 +2,7 @@ ssb-mentions Copyright (c) 2016 Dominic Tarr +Copyright (c) 2020 Charles Lehner Permission is hereby granted, free of charge, to any person obtaining a copy of this software and @@ -27,6 +28,7 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. var ref = require('ssb-ref') var marked = require('./ssb-marked') +var u = require('../lib/util') function noop(){} var onLink = noop var extractor = new marked.Renderer() @@ -91,6 +93,10 @@ module.exports = function (text, opts) { var emoji = opts && opts.emoji var a = [] links(text, function (link) { + if (link.target && typeof link.target === 'string' + && link.target.substr(0, 4) === 'ssb:') { + link.target = u.translateFromURI(link.target) || link.target + } var result = link.target && ref.parseLink(link.target) if (result) { result.name = link.label && link.label.replace(/^@/, '') |