Add class to search term highlighting. Fixes #92.
This commit is contained in:
parent
02c29b4de3
commit
ade3d15bca
|
@ -2,6 +2,9 @@
|
||||||
|
|
||||||
## v0.13-dev
|
## v0.13-dev
|
||||||
|
|
||||||
|
### Added
|
||||||
|
- Added a class to the search term highlighting to aid theming (#92)
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
- Sort the list of all the tags on a wiki (#88)
|
- Sort the list of all the tags on a wiki (#88)
|
||||||
- Explicitly set permissions on parent directories created (#86)
|
- Explicitly set permissions on parent directories created (#86)
|
|
@ -2616,7 +2616,7 @@ class search
|
||||||
foreach($qterms as $qterm)
|
foreach($qterms as $qterm)
|
||||||
{
|
{
|
||||||
// From http://stackoverflow.com/a/2483859/1460422
|
// From http://stackoverflow.com/a/2483859/1460422
|
||||||
$context = preg_replace("/" . str_replace("/", "\/", preg_quote($qterm)) . "/i", "<strong>$0</strong>", $context);
|
$context = preg_replace("/" . str_replace("/", "\/", preg_quote($qterm)) . "/i", "<strong class='search-term-highlight'>$0</strong>", $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $context;
|
return $context;
|
|
@ -68,7 +68,7 @@
|
||||||
"author": "Starbeamrainbowlabs",
|
"author": "Starbeamrainbowlabs",
|
||||||
"description": "Adds proper search functionality to Pepperminty Wiki using an inverted index to provide a full text search engine. If pages don't show up, then you might have hit a stop word. If not, try requesting the `invindex-rebuild` action to rebuild the inverted index from scratch.",
|
"description": "Adds proper search functionality to Pepperminty Wiki using an inverted index to provide a full text search engine. If pages don't show up, then you might have hit a stop word. If not, try requesting the `invindex-rebuild` action to rebuild the inverted index from scratch.",
|
||||||
"id": "feature-search",
|
"id": "feature-search",
|
||||||
"lastupdate": 1471592829,
|
"lastupdate": 1471597360,
|
||||||
"optional": false
|
"optional": false
|
||||||
},
|
},
|
||||||
{
|
{
|
|
@ -543,7 +543,7 @@ class search
|
||||||
foreach($qterms as $qterm)
|
foreach($qterms as $qterm)
|
||||||
{
|
{
|
||||||
// From http://stackoverflow.com/a/2483859/1460422
|
// From http://stackoverflow.com/a/2483859/1460422
|
||||||
$context = preg_replace("/" . str_replace("/", "\/", preg_quote($qterm)) . "/i", "<strong>$0</strong>", $context);
|
$context = preg_replace("/" . str_replace("/", "\/", preg_quote($qterm)) . "/i", "<strong class='search-term-highlight'>$0</strong>", $context);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $context;
|
return $context;
|
Loading…
Reference in New Issue