@@ -775,26 +775,19 @@ void DocParser::handleUnclosedStyleCommands()
775775 }
776776}
777777
778- bool DocParser::matchWord (const QCString &word,const StringVector &l)
779- {
780- for (const auto &s : l)
781- {
782- std::string prefix = s.substr (0 ,word.length ());
783- if (qstrcmp (prefix.c_str (),word)==0 )
784- {
785- return TRUE ;
786- }
787- }
788- return FALSE ;
789- }
790-
791778void DocParser::handleLinkedWord (DocNodeVariant *parent,DocNodeList &children,bool ignoreAutoLinkFlag)
792779{
780+ // helper to check if word w starts with any of the words in AUTOLINK_IGNORE_WORDS
781+ auto ignoreWord = [](const QCString &w) -> bool {
782+ const auto &list = Config_getList (AUTOLINK_IGNORE_WORDS);
783+ return std::find_if (list.begin (), list.end (),
784+ [&w](const auto &ignore) { return w.startsWith (ignore); }
785+ )!=list.end ();
786+ };
793787 QCString name = linkToText (context.lang ,context.token ->name ,TRUE );
794788 AUTO_TRACE (" word={}" ,name);
795789 bool autolinkSupport = Config_getBool (AUTOLINK_SUPPORT);
796- if ((!autolinkSupport && !ignoreAutoLinkFlag)
797- || matchWord (context.token ->name ,Config_getList (AUTOLINK_IGNORED_TOKENS))) // no autolinking -> add as normal word
790+ if ((!autolinkSupport && !ignoreAutoLinkFlag) || ignoreWord (context.token ->name )) // no autolinking -> add as normal word
798791 {
799792 children.append <DocWord>(this ,parent,name);
800793 return ;
0 commit comments