Last modified: 2014-08-09 09:38:24 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T69784, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 67784 - jquery.highlightText.js needs to be able to highlight more than one word, numbers, spaces, and punctuation
jquery.highlightText.js needs to be able to highlight more than one word, num...
Status: NEW
Product: MediaWiki
Classification: Unclassified
JavaScript (Other open bugs)
1.24rc
All All
: Low enhancement (vote)
: ---
Assigned To: Nobody - You can work on this!
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2014-07-10 00:47 UTC by WhatamIdoing
Modified: 2014-08-09 09:38 UTC (History)
3 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments

Description WhatamIdoing 2014-07-10 00:47:29 UTC
I'm passing this request along:

To the devs and volunteer coders:  Please see this snippet that uses mediawiki functions::  https://en.wikipedia.org/wiki/User:Dank/wishywashy.js 

If you add that to your .js file on en.wp, then every occurrence of wishy or washy will appear in bold for you ... and if you hover over the bolded word, you'll get some helpful advice. People would like for me to automate some of my copyediting advice using this script, but highlightText, as coded in Mediawiki, won't even let me search for a two-word phrase. Ideally, I'd like to have arguments that are regex searches (or the lua equivalent), but at a minimum, I need to search for letters, numbers, spaces and punctuation, if I'm going to be using highlightText. (If your solution allows something like regex, I only need highlighting for the initial phrase that appears before any special regex functions.) 


Being able to highlight two words seems like a very useful feature.  I've already got ideas about how I might use this if it were possible.
Comment 1 Dan Kindsvater 2014-07-15 21:43:48 UTC
Clarification: highlightText can handle all the punctuation I'm likely to need (,."?!/:;)
but it can't handle spaces.
Comment 2 Dan Kindsvater 2014-08-09 09:38:24 UTC
A (possibly older) version of highlightText is at https://git.wikimedia.org/blob/mediawiki%2Fcore/596a2584b0ea7ca5de24e871e015a9ac03122c3e/resources%2Fjquery%2Fjquery.highlightText.js.

I need a function (in or outside of Mediawiki) identical to highlightText, with (I'm guessing) the space in pat.split(" ") in line 12 replaced ... a tab character would work. (Or, getting rid of the parsing entirely so I can pass an array of strings would be fine.)

Dan

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links