Hello,
Danielo515 has introduced a useful widget (context.js*) which looks for a word inside a tiddler and shows the result with the searched word highlighted with some of its context.
It extract before
characters before the word and after
afterwards. (before
and after
are parameters).
I would rather have the widget to extract the context before up to the beginning of the line containing the word instead of a fixed number of characters.
I think that this should be possible with a modification in the following regexp.
var regString = "(\\w+[\\s\\S]{0,#before#})?(#term#)([\\s\\S]{0,#after#}\\w+)?";
However, I was not able to have something work (trying several things such as (\\n[\\s\\S]*)?(#term#)([\\s\\S]{0,#after#}\\w+)?";
)
Any idea to make it work?
BR,
Eskha