Sotaro KARASAWA 9 lat temu
rodzic
commit
6e6042c19c
1 zmienionych plików z 0 dodań i 18 usunięć
  1. 0 18
      test.js

+ 0 - 18
test.js

@@ -1,18 +0,0 @@
-
-const body = `# ほげ
-
-検診 <- これは highlight
-<a href="検診">検診</a>
-
-[検診](検診) <- non highlight
-
-ほげ(検診)ほげ <- highlight
-ほげ[検診]ほげ <- highlight
-
-<a href="検診">検診</a> 検診 <- nhl hl hl
-`;
-
-const k = '検診'; //keyword.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
-const keywordExp = new RegExp(`(${k}(?!(.*?\]|.*?\\)|.*?"|.*?>)))`, 'ig');
-
-console.log(body.replace(keywordExp, '<em class="highlighted">$&</em>'));