this repo has no description
0
fork

Configure Feed

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

Need QSA to be forgiving

+152 -136
+20 -4
src/components/status.jsx
··· 125 125 ); 126 126 } 127 127 128 + function forgivingQSA(selectors = [], dom = document) { 129 + // Run QSA for list of selectors 130 + // If a selector return invalid selector error, try the next one 131 + for (const selector of selectors) { 132 + try { 133 + return dom.querySelectorAll(selector); 134 + } catch (e) {} 135 + } 136 + return []; 137 + } 138 + 128 139 function isTranslateble(content) { 129 140 if (!content) return false; 130 141 content = content.trim(); ··· 132 143 const text = getHTMLText(content, { 133 144 preProcess: (dom) => { 134 145 // Remove .mention, pre, code, a:has(.invisible) 135 - for (const a of dom.querySelectorAll( 136 - '.mention, pre, code, a:has(.invisible)', 146 + for (const a of forgivingQSA( 147 + ['.mention, pre, code, a:has(.invisible)', '.mention, pre, code'], 148 + dom, 137 149 )) { 138 150 a.remove(); 139 151 } ··· 148 160 // Remove anything that can skew the language detection 149 161 150 162 // Remove .mention, .hashtag, pre, code, a:has(.invisible) 151 - for (const a of dom.querySelectorAll( 152 - '.mention, .hashtag, pre, code, a:has(.invisible)', 163 + for (const a of forgivingQSA( 164 + [ 165 + '.mention, .hashtag, pre, code, a:has(.invisible)', 166 + '.mention, .hashtag, pre, code', 167 + ], 168 + dom, 153 169 )) { 154 170 a.remove(); 155 171 }
+132 -132
src/locales/en.po
··· 32 32 33 33 #: src/components/account-block.jsx:168 34 34 #: src/components/account-info.jsx:641 35 - #: src/components/status.jsx:498 35 + #: src/components/status.jsx:514 36 36 msgid "Group" 37 37 msgstr "" 38 38 ··· 107 107 #: src/components/compose.jsx:2488 108 108 #: src/components/media-alt-modal.jsx:45 109 109 #: src/components/media-modal.jsx:357 110 - #: src/components/status.jsx:1721 111 - #: src/components/status.jsx:1738 112 - #: src/components/status.jsx:1862 113 - #: src/components/status.jsx:2474 114 - #: src/components/status.jsx:2477 110 + #: src/components/status.jsx:1737 111 + #: src/components/status.jsx:1754 112 + #: src/components/status.jsx:1878 113 + #: src/components/status.jsx:2490 114 + #: src/components/status.jsx:2493 115 115 #: src/pages/account-statuses.jsx:528 116 116 #: src/pages/accounts.jsx:109 117 117 #: src/pages/hashtag.jsx:199 ··· 180 180 msgstr "" 181 181 182 182 #: src/components/account-info.jsx:864 183 - #: src/components/status.jsx:2252 183 + #: src/components/status.jsx:2268 184 184 #: src/pages/catchup.jsx:71 185 185 #: src/pages/catchup.jsx:1445 186 186 #: src/pages/catchup.jsx:2056 ··· 276 276 msgstr "" 277 277 278 278 #: src/components/account-info.jsx:1304 279 - #: src/components/status.jsx:1161 279 + #: src/components/status.jsx:1177 280 280 msgid "Link copied" 281 281 msgstr "" 282 282 283 283 #: src/components/account-info.jsx:1307 284 - #: src/components/status.jsx:1164 284 + #: src/components/status.jsx:1180 285 285 msgid "Unable to copy link" 286 286 msgstr "" 287 287 288 288 #: src/components/account-info.jsx:1313 289 289 #: src/components/shortcuts-settings.jsx:1059 290 - #: src/components/status.jsx:1170 291 - #: src/components/status.jsx:3251 290 + #: src/components/status.jsx:1186 291 + #: src/components/status.jsx:3267 292 292 msgid "Copy" 293 293 msgstr "" 294 294 295 295 #: src/components/account-info.jsx:1328 296 296 #: src/components/shortcuts-settings.jsx:1077 297 - #: src/components/status.jsx:1186 297 + #: src/components/status.jsx:1202 298 298 msgid "Sharing doesn't seem to work." 299 299 msgstr "" 300 300 301 301 #: src/components/account-info.jsx:1334 302 - #: src/components/status.jsx:1192 302 + #: src/components/status.jsx:1208 303 303 msgid "Share…" 304 304 msgstr "" 305 305 ··· 416 416 #: src/components/shortcuts-settings.jsx:230 417 417 #: src/components/shortcuts-settings.jsx:583 418 418 #: src/components/shortcuts-settings.jsx:783 419 - #: src/components/status.jsx:2976 420 - #: src/components/status.jsx:3215 421 - #: src/components/status.jsx:3713 419 + #: src/components/status.jsx:2992 420 + #: src/components/status.jsx:3231 421 + #: src/components/status.jsx:3729 422 422 #: src/pages/accounts.jsx:36 423 423 #: src/pages/catchup.jsx:1581 424 424 #: src/pages/filters.jsx:224 ··· 608 608 msgstr "" 609 609 610 610 #: src/components/compose.jsx:1139 611 - #: src/components/status.jsx:2047 611 + #: src/components/status.jsx:2063 612 612 #: src/components/timeline.jsx:984 613 613 msgid "Content warning" 614 614 msgstr "" ··· 644 644 645 645 #: src/components/compose.jsx:1206 646 646 #: src/components/status.jsx:97 647 - #: src/components/status.jsx:1925 647 + #: src/components/status.jsx:1941 648 648 msgid "Private mention" 649 649 msgstr "" 650 650 ··· 674 674 675 675 #: src/components/compose.jsx:1504 676 676 #: src/components/keyboard-shortcuts-help.jsx:151 677 - #: src/components/status.jsx:913 678 - #: src/components/status.jsx:1701 679 - #: src/components/status.jsx:1702 680 - #: src/components/status.jsx:2370 677 + #: src/components/status.jsx:929 678 + #: src/components/status.jsx:1717 679 + #: src/components/status.jsx:1718 680 + #: src/components/status.jsx:2386 681 681 msgid "Reply" 682 682 msgstr "" 683 683 ··· 892 892 893 893 #: src/components/drafts.jsx:127 894 894 #: src/components/list-add-edit.jsx:185 895 - #: src/components/status.jsx:1336 895 + #: src/components/status.jsx:1352 896 896 #: src/pages/filters.jsx:587 897 897 msgid "Delete…" 898 898 msgstr "" ··· 1100 1100 msgstr "" 1101 1101 1102 1102 #: src/components/keyboard-shortcuts-help.jsx:172 1103 - #: src/components/status.jsx:921 1104 - #: src/components/status.jsx:2396 1105 - #: src/components/status.jsx:2428 1106 - #: src/components/status.jsx:2429 1103 + #: src/components/status.jsx:937 1104 + #: src/components/status.jsx:2412 1105 + #: src/components/status.jsx:2444 1106 + #: src/components/status.jsx:2445 1107 1107 msgid "Boost" 1108 1108 msgstr "" 1109 1109 ··· 1112 1112 msgstr "" 1113 1113 1114 1114 #: src/components/keyboard-shortcuts-help.jsx:180 1115 - #: src/components/status.jsx:1006 1116 - #: src/components/status.jsx:2453 1117 - #: src/components/status.jsx:2454 1115 + #: src/components/status.jsx:1022 1116 + #: src/components/status.jsx:2469 1117 + #: src/components/status.jsx:2470 1118 1118 msgid "Bookmark" 1119 1119 msgstr "" 1120 1120 ··· 1173 1173 msgstr "" 1174 1174 1175 1175 #: src/components/media-alt-modal.jsx:57 1176 - #: src/components/status.jsx:1050 1177 - #: src/components/status.jsx:1077 1176 + #: src/components/status.jsx:1066 1177 + #: src/components/status.jsx:1093 1178 1178 #: src/components/translation-block.jsx:195 1179 1179 msgid "Translate" 1180 1180 msgstr "" 1181 1181 1182 1182 #: src/components/media-alt-modal.jsx:68 1183 - #: src/components/status.jsx:1064 1184 - #: src/components/status.jsx:1091 1183 + #: src/components/status.jsx:1080 1184 + #: src/components/status.jsx:1107 1185 1185 msgid "Speak" 1186 1186 msgstr "" 1187 1187 ··· 1218 1218 msgstr "" 1219 1219 1220 1220 #: src/components/media-post.jsx:133 1221 - #: src/components/status.jsx:3543 1222 - #: src/components/status.jsx:3639 1223 - #: src/components/status.jsx:3717 1221 + #: src/components/status.jsx:3559 1222 + #: src/components/status.jsx:3655 1223 + #: src/components/status.jsx:3733 1224 1224 #: src/components/timeline.jsx:973 1225 1225 #: src/pages/catchup.jsx:75 1226 1226 #: src/pages/catchup.jsx:1876 ··· 1508 1508 msgstr "" 1509 1509 1510 1510 #: src/components/notification.jsx:434 1511 - #: src/components/status.jsx:1020 1512 - #: src/components/status.jsx:1030 1511 + #: src/components/status.jsx:1036 1512 + #: src/components/status.jsx:1046 1513 1513 msgid "Boosted/Liked by…" 1514 1514 msgstr "" 1515 1515 ··· 1531 1531 msgstr "" 1532 1532 1533 1533 #: src/components/notification.jsx:756 1534 - #: src/components/status.jsx:251 1534 + #: src/components/status.jsx:267 1535 1535 msgid "Read more →" 1536 1536 msgstr "" 1537 1537 ··· 1824 1824 msgstr "" 1825 1825 1826 1826 #: src/components/shortcuts-settings.jsx:379 1827 - #: src/components/status.jsx:1298 1827 + #: src/components/status.jsx:1314 1828 1828 #: src/pages/list.jsx:170 1829 1829 msgid "Edit" 1830 1830 msgstr "" ··· 2022 2022 msgid "Import/export settings from/to instance server (Very experimental)" 2023 2023 msgstr "" 2024 2024 2025 - #: src/components/status.jsx:522 2025 + #: src/components/status.jsx:538 2026 2026 msgid "<0/> <1>boosted</1>" 2027 2027 msgstr "" 2028 2028 2029 - #: src/components/status.jsx:621 2029 + #: src/components/status.jsx:637 2030 2030 msgid "Sorry, your current logged-in instance can't interact with this post from another instance." 2031 2031 msgstr "" 2032 2032 2033 - #: src/components/status.jsx:774 2033 + #: src/components/status.jsx:790 2034 2034 msgid "Unliked @{0}'s post" 2035 2035 msgstr "" 2036 2036 2037 - #: src/components/status.jsx:775 2037 + #: src/components/status.jsx:791 2038 2038 msgid "Liked @{0}'s post" 2039 2039 msgstr "" 2040 2040 2041 - #: src/components/status.jsx:814 2041 + #: src/components/status.jsx:830 2042 2042 msgid "Unbookmarked @{0}'s post" 2043 2043 msgstr "" 2044 2044 2045 - #: src/components/status.jsx:815 2045 + #: src/components/status.jsx:831 2046 2046 msgid "Bookmarked @{0}'s post" 2047 2047 msgstr "" 2048 2048 2049 - #: src/components/status.jsx:921 2050 - #: src/components/status.jsx:983 2051 - #: src/components/status.jsx:2396 2052 - #: src/components/status.jsx:2428 2049 + #: src/components/status.jsx:937 2050 + #: src/components/status.jsx:999 2051 + #: src/components/status.jsx:2412 2052 + #: src/components/status.jsx:2444 2053 2053 msgid "Unboost" 2054 2054 msgstr "" 2055 2055 2056 - #: src/components/status.jsx:937 2057 - #: src/components/status.jsx:2411 2056 + #: src/components/status.jsx:953 2057 + #: src/components/status.jsx:2427 2058 2058 msgid "Quote" 2059 2059 msgstr "" 2060 2060 2061 - #: src/components/status.jsx:945 2062 - #: src/components/status.jsx:2420 2061 + #: src/components/status.jsx:961 2062 + #: src/components/status.jsx:2436 2063 2063 msgid "Some media have no descriptions." 2064 2064 msgstr "" 2065 2065 2066 - #: src/components/status.jsx:952 2066 + #: src/components/status.jsx:968 2067 2067 msgid "Old post (<0>{0}</0>)" 2068 2068 msgstr "" 2069 2069 2070 - #: src/components/status.jsx:971 2071 - #: src/components/status.jsx:1426 2070 + #: src/components/status.jsx:987 2071 + #: src/components/status.jsx:1442 2072 2072 msgid "Unboosted @{0}'s post" 2073 2073 msgstr "" 2074 2074 2075 - #: src/components/status.jsx:972 2076 - #: src/components/status.jsx:1427 2075 + #: src/components/status.jsx:988 2076 + #: src/components/status.jsx:1443 2077 2077 msgid "Boosted @{0}'s post" 2078 2078 msgstr "" 2079 2079 2080 - #: src/components/status.jsx:984 2080 + #: src/components/status.jsx:1000 2081 2081 msgid "Boost…" 2082 2082 msgstr "" 2083 2083 2084 - #: src/components/status.jsx:996 2085 - #: src/components/status.jsx:1711 2086 - #: src/components/status.jsx:2441 2084 + #: src/components/status.jsx:1012 2085 + #: src/components/status.jsx:1727 2086 + #: src/components/status.jsx:2457 2087 2087 msgid "Unlike" 2088 2088 msgstr "" 2089 2089 2090 - #: src/components/status.jsx:997 2091 - #: src/components/status.jsx:1711 2092 - #: src/components/status.jsx:1712 2093 - #: src/components/status.jsx:2441 2094 - #: src/components/status.jsx:2442 2090 + #: src/components/status.jsx:1013 2091 + #: src/components/status.jsx:1727 2092 + #: src/components/status.jsx:1728 2093 + #: src/components/status.jsx:2457 2094 + #: src/components/status.jsx:2458 2095 2095 msgid "Like" 2096 2096 msgstr "" 2097 2097 2098 - #: src/components/status.jsx:1006 2099 - #: src/components/status.jsx:2453 2098 + #: src/components/status.jsx:1022 2099 + #: src/components/status.jsx:2469 2100 2100 msgid "Unbookmark" 2101 2101 msgstr "" 2102 2102 2103 - #: src/components/status.jsx:1114 2103 + #: src/components/status.jsx:1130 2104 2104 msgid "View post by <0>@{0}</0>" 2105 2105 msgstr "" 2106 2106 2107 - #: src/components/status.jsx:1135 2107 + #: src/components/status.jsx:1151 2108 2108 msgid "Show Edit History" 2109 2109 msgstr "" 2110 2110 2111 - #: src/components/status.jsx:1138 2111 + #: src/components/status.jsx:1154 2112 2112 msgid "Edited: {editedDateText}" 2113 2113 msgstr "" 2114 2114 2115 - #: src/components/status.jsx:1205 2116 - #: src/components/status.jsx:3220 2115 + #: src/components/status.jsx:1221 2116 + #: src/components/status.jsx:3236 2117 2117 msgid "Embed post" 2118 2118 msgstr "" 2119 2119 2120 - #: src/components/status.jsx:1219 2120 + #: src/components/status.jsx:1235 2121 2121 msgid "Conversation unmuted" 2122 2122 msgstr "" 2123 2123 2124 - #: src/components/status.jsx:1219 2124 + #: src/components/status.jsx:1235 2125 2125 msgid "Conversation muted" 2126 2126 msgstr "" 2127 2127 2128 - #: src/components/status.jsx:1225 2128 + #: src/components/status.jsx:1241 2129 2129 msgid "Unable to unmute conversation" 2130 2130 msgstr "" 2131 2131 2132 - #: src/components/status.jsx:1226 2132 + #: src/components/status.jsx:1242 2133 2133 msgid "Unable to mute conversation" 2134 2134 msgstr "" 2135 2135 2136 - #: src/components/status.jsx:1235 2136 + #: src/components/status.jsx:1251 2137 2137 msgid "Unmute conversation" 2138 2138 msgstr "" 2139 2139 2140 - #: src/components/status.jsx:1242 2140 + #: src/components/status.jsx:1258 2141 2141 msgid "Mute conversation" 2142 2142 msgstr "" 2143 2143 2144 - #: src/components/status.jsx:1258 2144 + #: src/components/status.jsx:1274 2145 2145 msgid "Post unpinned from profile" 2146 2146 msgstr "" 2147 2147 2148 - #: src/components/status.jsx:1259 2148 + #: src/components/status.jsx:1275 2149 2149 msgid "Post pinned to profile" 2150 2150 msgstr "" 2151 2151 2152 - #: src/components/status.jsx:1264 2152 + #: src/components/status.jsx:1280 2153 2153 msgid "Unable to unpin post" 2154 2154 msgstr "" 2155 2155 2156 - #: src/components/status.jsx:1264 2156 + #: src/components/status.jsx:1280 2157 2157 msgid "Unable to pin post" 2158 2158 msgstr "" 2159 2159 2160 - #: src/components/status.jsx:1273 2160 + #: src/components/status.jsx:1289 2161 2161 msgid "Unpin from profile" 2162 2162 msgstr "" 2163 2163 2164 - #: src/components/status.jsx:1280 2164 + #: src/components/status.jsx:1296 2165 2165 msgid "Pin to profile" 2166 2166 msgstr "" 2167 2167 2168 - #: src/components/status.jsx:1309 2168 + #: src/components/status.jsx:1325 2169 2169 msgid "Delete this post?" 2170 2170 msgstr "" 2171 2171 2172 - #: src/components/status.jsx:1325 2172 + #: src/components/status.jsx:1341 2173 2173 msgid "Post deleted" 2174 2174 msgstr "" 2175 2175 2176 - #: src/components/status.jsx:1328 2176 + #: src/components/status.jsx:1344 2177 2177 msgid "Unable to delete post" 2178 2178 msgstr "" 2179 2179 2180 - #: src/components/status.jsx:1356 2180 + #: src/components/status.jsx:1372 2181 2181 msgid "Report post…" 2182 2182 msgstr "" 2183 2183 2184 - #: src/components/status.jsx:1712 2185 - #: src/components/status.jsx:1748 2186 - #: src/components/status.jsx:2442 2184 + #: src/components/status.jsx:1728 2185 + #: src/components/status.jsx:1764 2186 + #: src/components/status.jsx:2458 2187 2187 msgid "Liked" 2188 2188 msgstr "" 2189 2189 2190 - #: src/components/status.jsx:1745 2191 - #: src/components/status.jsx:2429 2190 + #: src/components/status.jsx:1761 2191 + #: src/components/status.jsx:2445 2192 2192 msgid "Boosted" 2193 2193 msgstr "" 2194 2194 2195 - #: src/components/status.jsx:1755 2196 - #: src/components/status.jsx:2454 2195 + #: src/components/status.jsx:1771 2196 + #: src/components/status.jsx:2470 2197 2197 msgid "Bookmarked" 2198 2198 msgstr "" 2199 2199 2200 - #: src/components/status.jsx:1759 2200 + #: src/components/status.jsx:1775 2201 2201 msgid "Pinned" 2202 2202 msgstr "" 2203 2203 2204 - #: src/components/status.jsx:1804 2205 - #: src/components/status.jsx:2260 2204 + #: src/components/status.jsx:1820 2205 + #: src/components/status.jsx:2276 2206 2206 msgid "Deleted" 2207 2207 msgstr "" 2208 2208 2209 - #: src/components/status.jsx:1845 2209 + #: src/components/status.jsx:1861 2210 2210 msgid "{repliesCount, plural, one {# reply} other {# replies}}" 2211 2211 msgstr "" 2212 2212 2213 - #: src/components/status.jsx:1934 2213 + #: src/components/status.jsx:1950 2214 2214 msgid "Thread{0}" 2215 2215 msgstr "" 2216 2216 2217 - #: src/components/status.jsx:2010 2218 - #: src/components/status.jsx:2072 2219 - #: src/components/status.jsx:2157 2217 + #: src/components/status.jsx:2026 2218 + #: src/components/status.jsx:2088 2219 + #: src/components/status.jsx:2173 2220 2220 msgid "Show less" 2221 2221 msgstr "" 2222 2222 2223 - #: src/components/status.jsx:2010 2224 - #: src/components/status.jsx:2072 2223 + #: src/components/status.jsx:2026 2224 + #: src/components/status.jsx:2088 2225 2225 msgid "Show content" 2226 2226 msgstr "" 2227 2227 2228 - #: src/components/status.jsx:2157 2228 + #: src/components/status.jsx:2173 2229 2229 msgid "Show media" 2230 2230 msgstr "" 2231 2231 2232 - #: src/components/status.jsx:2294 2232 + #: src/components/status.jsx:2310 2233 2233 msgid "Edited" 2234 2234 msgstr "" 2235 2235 2236 - #: src/components/status.jsx:2371 2236 + #: src/components/status.jsx:2387 2237 2237 msgid "Comments" 2238 2238 msgstr "" 2239 2239 2240 2240 #. More from [Author] 2241 - #: src/components/status.jsx:2680 2241 + #: src/components/status.jsx:2696 2242 2242 msgid "More from <0/>" 2243 2243 msgstr "More from <0/>" 2244 2244 2245 - #: src/components/status.jsx:2981 2245 + #: src/components/status.jsx:2997 2246 2246 msgid "Edit History" 2247 2247 msgstr "" 2248 2248 2249 - #: src/components/status.jsx:2985 2249 + #: src/components/status.jsx:3001 2250 2250 msgid "Failed to load history" 2251 2251 msgstr "" 2252 2252 2253 - #: src/components/status.jsx:2990 2253 + #: src/components/status.jsx:3006 2254 2254 msgid "Loading…" 2255 2255 msgstr "" 2256 2256 2257 - #: src/components/status.jsx:3225 2257 + #: src/components/status.jsx:3241 2258 2258 msgid "HTML Code" 2259 2259 msgstr "" 2260 2260 2261 - #: src/components/status.jsx:3242 2261 + #: src/components/status.jsx:3258 2262 2262 msgid "HTML code copied" 2263 2263 msgstr "" 2264 2264 2265 - #: src/components/status.jsx:3245 2265 + #: src/components/status.jsx:3261 2266 2266 msgid "Unable to copy HTML code" 2267 2267 msgstr "" 2268 2268 2269 - #: src/components/status.jsx:3257 2269 + #: src/components/status.jsx:3273 2270 2270 msgid "Media attachments:" 2271 2271 msgstr "" 2272 2272 2273 - #: src/components/status.jsx:3279 2273 + #: src/components/status.jsx:3295 2274 2274 msgid "Account Emojis:" 2275 2275 msgstr "" 2276 2276 2277 - #: src/components/status.jsx:3310 2278 - #: src/components/status.jsx:3355 2277 + #: src/components/status.jsx:3326 2278 + #: src/components/status.jsx:3371 2279 2279 msgid "static URL" 2280 2280 msgstr "" 2281 2281 2282 - #: src/components/status.jsx:3324 2282 + #: src/components/status.jsx:3340 2283 2283 msgid "Emojis:" 2284 2284 msgstr "" 2285 2285 2286 - #: src/components/status.jsx:3369 2286 + #: src/components/status.jsx:3385 2287 2287 msgid "Notes:" 2288 2288 msgstr "" 2289 2289 2290 - #: src/components/status.jsx:3373 2290 + #: src/components/status.jsx:3389 2291 2291 msgid "This is static, unstyled and scriptless. You may need to apply your own styles and edit as needed." 2292 2292 msgstr "" 2293 2293 2294 - #: src/components/status.jsx:3379 2294 + #: src/components/status.jsx:3395 2295 2295 msgid "Polls are not interactive, becomes a list with vote counts." 2296 2296 msgstr "" 2297 2297 2298 - #: src/components/status.jsx:3384 2298 + #: src/components/status.jsx:3400 2299 2299 msgid "Media attachments can be images, videos, audios or any file types." 2300 2300 msgstr "" 2301 2301 2302 - #: src/components/status.jsx:3390 2302 + #: src/components/status.jsx:3406 2303 2303 msgid "Post could be edited or deleted later." 2304 2304 msgstr "" 2305 2305 2306 - #: src/components/status.jsx:3396 2306 + #: src/components/status.jsx:3412 2307 2307 msgid "Preview" 2308 2308 msgstr "" 2309 2309 2310 - #: src/components/status.jsx:3405 2310 + #: src/components/status.jsx:3421 2311 2311 msgid "Note: This preview is lightly styled." 2312 2312 msgstr "" 2313 2313 2314 2314 #. [Name] [Visibility icon] boosted 2315 - #: src/components/status.jsx:3647 2315 + #: src/components/status.jsx:3663 2316 2316 msgid "<0/> <1/> boosted" 2317 2317 msgstr "" 2318 2318