Commit 6f4a164dcf3ceba120878c266e2f477496eb7b3e
make raw msg links work, relax ?-prefix requirment for search
mix irving committed on 3/30/2017, 4:59:02 AMParent: dc1af5e85e5120dcd7fb92d8da7338908ff423e8
Files changed
message/html/meta/raw.js | changed |
router/html/page/search.js | changed |
message/html/meta/raw.js | ||
---|---|---|
@@ -58,8 +58,8 @@ | ||
58 | 58 | var refRegex = /((?:@|%|&)[A-Za-z0-9\/+]{43}=\.[\w\d]+)/g |
59 | 59 | |
60 | 60 | var arr = text.split(refRegex) |
61 | 61 | for (var i = 1; i < arr.length; i += 2) { |
62 | - arr[i] = h('a', {href: '#' + arr[i]}, arr[i]) | |
62 | + arr[i] = h('a', {href: arr[i]}, arr[i]) | |
63 | 63 | } |
64 | 64 | return arr |
65 | 65 | } |
router/html/page/search.js | ||
---|---|---|
@@ -75,11 +75,11 @@ | ||
75 | 75 | |
76 | 76 | return nest('router.html.page', searchPage) |
77 | 77 | |
78 | 78 | function searchPage (path) { |
79 | - if (path[0] !== '?') return | |
79 | + if (path.match(/^[@#%\/]/)) return | |
80 | 80 | |
81 | - var queryStr = path.substr(1).trim() | |
81 | + var queryStr = path.replace(/^\??/, '').trim() | |
82 | 82 | var query = queryStr.split(whitespace) |
83 | 83 | var matchesQuery = searchFilter(query) |
84 | 84 | |
85 | 85 | const search = Struct({ |
Built with git-ssb-web