소스 검색

Improve Twitter regex

Zed 4 년 전
부모
커밋
1e1e034237
1개의 변경된 파일1개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      src/formatters.nim

+ 1 - 1
src/formatters.nim

@@ -14,7 +14,7 @@ const
   # Images aren't supported due to errors from Teddit when the image
   # wasn't first displayed via a post on the Teddit instance.
 
-  twRegex = re"(?<![^\/> ])(?<![^\/]\/)(www\.|mobile\.)?twitter\.com"
+  twRegex = re"(?<=(?<!\S)https:\/\/|(?<=\s))(www\.|mobile\.)?twitter\.com"
   cards = "cards.twitter.com/cards"
   tco = "https://t.co"