Commit f8f6dea260ff781d496a17158ef9fd91603b8ea5
use `ref.normalizeChannel` for indexing to make case insensitive
Matt McKegg committed on 11/20/2017, 3:27:51 AMParent: 5a54f8ce3a5ceb141438521584923130a229f879
Files changed
emit-links.js | changed |
index.js | changed |
package.json | changed |
emit-links.js | ||
---|---|---|
@@ -9,14 +9,16 @@ | ||
9 | 9 … | var links = new Set() |
10 | 10 … | walk(msg.value.content, function (path, value) { |
11 | 11 … | // HACK: handle legacy channel mentions |
12 | 12 … | if (deepEqual(path, ['channel']) && typeof value === 'string' && value.length < 30) { |
13 | - value = `#${value.replace(/\s/g, '')}` | |
13 … | + value = `#${ref.normalizeChannel(value)}` | |
14 | 14 … | } |
15 | 15 … | |
16 | 16 … | // TODO: should add channel matching to ref.type |
17 | - if (ref.type(value) || isChannel(value)) { | |
17 … | + if (ref.type(value)) { | |
18 | 18 … | links.add(value) |
19 … | + } else if (isChannel(value)) { | |
20 … | + links.add(ref.normalizeChannel(value)) | |
19 | 21 … | } |
20 | 22 … | }) |
21 | 23 … | links.forEach(link => { |
22 | 24 … | emit(extend(msg, { |
index.js | ||
---|---|---|
@@ -8,9 +8,9 @@ | ||
8 | 8 … | { key: 'DTA', value: [['dest'], ['value', 'timestamp']] }, // asserted timestamp |
9 | 9 … | { key: 'TDT', value: [['value', 'content', 'type'], ['dest'], ['value', 'timestamp']] } |
10 | 10 … | ] |
11 | 11 … | |
12 | -var indexVersion = 3 | |
12 … | +var indexVersion = 5 | |
13 | 13 … | |
14 | 14 … | exports.name = 'backlinks' |
15 | 15 … | exports.version = require('./package.json').version |
16 | 16 … | exports.manifest = { |
Built with git-ssb-web