feat: filter support plain link (#1657)

* fix: unexpected empty lines when copying-pasting

* add ref

* feat: support to filter plain link

* eslint

* fix the typo

* fix the typo

* unified the import path
This commit is contained in:
CorrectRoadH
2023-05-14 23:17:18 +08:00
committed by GitHub
parent 2cc5691efd
commit d72b4e9a98
3 changed files with 5 additions and 3 deletions

View File

@ -8,6 +8,7 @@ import { DEFAULT_MEMO_LIMIT } from "@/helpers/consts";
import { checkShouldShowMemoWithFilters } from "@/helpers/filter";
import Memo from "./Memo";
import "@/less/memo-list.less";
import { PLAIN_LINK_REG } from "@/labs/marked/parser";
import copy from "copy-to-clipboard";
const MemoList = () => {
@ -62,7 +63,7 @@ const MemoList = () => {
if (memoType) {
if (memoType === "NOT_TAGGED" && memo.content.match(TAG_REG) !== null) {
shouldShow = false;
} else if (memoType === "LINKED" && memo.content.match(LINK_REG) === null) {
} else if (memoType === "LINKED" && (memo.content.match(LINK_REG) === null || memo.content.match(PLAIN_LINK_REG) === null)) {
shouldShow = false;
}
}