Bluesky app fork with some witchin' additions 💫
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Replace removed hasIndexes behavior

+11 -17
+11 -17
src/lib/strings.ts
··· 82 82 } else if (!match[3].includes('.')) { 83 83 continue // probably not a handle 84 84 } 85 + const start = text.indexOf(match[3], match.index) - 1 85 86 ents.push({ 86 87 type: 'mention', 87 88 value: match[3], 88 - index: { 89 - start: match.indices[2][0], // skip the (^|\s) but include the '@' 90 - end: match.indices[3][1], 91 - }, 89 + index: {start, end: start + match[3].length + 1}, 92 90 }) 93 91 } 94 92 } ··· 105 103 } 106 104 value = `https://${value}` 107 105 } 108 - const index = { 109 - start: match.indices[2][0], // skip the (^|\s) 110 - end: match.indices[2][1], 106 + const start = text.indexOf(match[2], match.index) 107 + const index = {start, end: start + match[2].length} 108 + // strip ending puncuation 109 + if (/[.,;!?]$/.test(value)) { 110 + value = value.slice(0, -1) 111 + index.end-- 111 112 } 112 - { 113 - // strip ending puncuation 114 - if (/[.,;!?]$/.test(value)) { 115 - value = value.slice(0, -1) 116 - index.end-- 117 - } 118 - if (/[)]$/.test(value) && !value.includes('(')) { 119 - value = value.slice(0, -1) 120 - index.end-- 121 - } 113 + if (/[)]$/.test(value) && !value.includes('(')) { 114 + value = value.slice(0, -1) 115 + index.end-- 122 116 } 123 117 ents.push({ 124 118 type: 'link',