Skip to content

Commit

Permalink
Blacklisting http and https in autolinking.
Browse files Browse the repository at this point in the history
  • Loading branch information
dvorka committed Jan 5, 2024
1 parent 53032fc commit b149848
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
9 changes: 9 additions & 0 deletions lib/src/mind/ai/autolinking/autolinking_mind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,15 @@ void AutolinkingMind::updateTrieIndex()
addThingToTrie(n);
}

// remove functional blacklist
vector<string> blacklist = {
"http",
"https",
};
for_each(blacklist.begin(), blacklist.end(), [this](const string& s) {
trie->removeWord(s);
});

// IMPROVE: add also tags

#ifdef DO_MF_DEBUG
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ void injectThingsLinks(cmark_node* srcNode, Mind& mind)
* Preprocessor.
*/

const string CmarkAhoCorasickBlockAutolinkingPreprocessor::TRAILING_CHARS = string{" \t,:;.!?<>{}&()-+/*\\_=%~#$^[]'\""};
const string CmarkAhoCorasickBlockAutolinkingPreprocessor::TRAILING_CHARS
= string{" \t,:;.!?<>{}&()-+/*\\_=%~#$^[]'\""};

CmarkAhoCorasickBlockAutolinkingPreprocessor::CmarkAhoCorasickBlockAutolinkingPreprocessor(Mind& mind)
: AutolinkingPreprocessor{mind}
Expand Down

0 comments on commit b149848

Please sign in to comment.