1 btreece Jul 07, 2016 03:27
3 btreece Jul 07, 2016 22:59
That did work. Thank you.
In 90 percent of my own cases, I'm linking names and such (like the NFL's Cowboys QB "Troy Aikman" would link to his tag archive tag/Troy+Aikman/
, for example). It seems the plugins functionality is limited to only two words, and in reverse order. As you said, unfriendly. I scanned the plugin file quickly and notice it's using regex for various functions, so wouldn't it be much more capable and friendly to users if it dropped the multiword syntax of word1;word2;;url
and instead allowed for text string;;url
?
The plugin's code is honestly a bit dense, so I wouldn't know where to start on making that particular adjustment. But it certainly seems to be the reasonable next step for development. Considering definitions are read line by line, easy enough to just ignore and preserve spaces from line start to the first semi-colon. For someone familiar with the code, that is.
Anyways, thanks again.
4 fplanque Jul 07, 2016 23:15
We'll make a complete overhaul of this plugin at some point, but you cannot imagine the size of our todo list.
The plugin used to be optimized for super fast processing of very long lists of keywords to replace. I am not sure if it still is the case.
5 btreece Jul 08, 2016 01:40
Oh, I can imagine. It's a huge plus of b2evo that so much function is included in the core, but it also means there's infinitely more to do.
Currently, the plugin checks for the $word (first word in a definition), and then checks to see if it's preceded by the second word (I saw that in the code and still didn't think to reverse the order). Seems like additional logic is required doing it that way, as opposed to simply treating the entire string up to the first semi-colon as the word. No checking what comes when, just does it exist? If so, link it.
Probably an oversimplified view of it, but seems to work. But hell, I'm still impressed that it's done server-side and not with javascript after the DOM is loaded. My browser thanks you!
Try
nation;cowboys;;https://twitter.com
(yes, the order is reversed. The definition format evolved with the history of the plugin and is a little bit unfriendly)