In the discussion “Watched Words and Oneboxes,” sciencewhiz points out that the content of Oneboxes is not run through the watched words filter, citing an example of an innocuous comic with a swear word in its alt text that is displayed in the Onebox without being flagged.
sam agrees it’s an interesting edge case but wonders how far to take filtering, suggesting relying on flagging for such cases instead.
sciencewhiz proposes running the watched words check on the Onebox text, which seems more practical than running OCR on images.
Alternatively, neounix suggests a quick JavaScript solution to filter or remove the title attribute for IMG HTML elements, providing an example of how this could be implemented.
It doesn’t appear that the content of Oneboxes is run through the watched words filter.
On our forum, we’ve had a number of people link to the following comic, for which the comic itself is innocuous, but the alt text has a swear word. The onebox picks up the alt text and displays it, however it isn’t flagged by the watched words feature. It would seem like the watched words filter should also check any text from the one box.
I agree it is an edge case. My assumption was that it wouldn’t be hard to get the onebox text and then run the watched words check, whereas running on OCR on images wouldn’t be practical.
Another quick approach, for this unique edge case is to simply filter or remove the title attribute for this or these HTML IMG element(s) with a minimal Javascript addition to your template(s).
A quick JS filter is easier to implement, I think, for sites which have strict edge case requirements for filtering the title attribute for an IMG HTML element: