1
0
Fork 0
mirror of https://github.com/sbrl/Pepperminty-Wiki.git synced 2024-12-25 14:45:02 +00:00

Don't include semicolons in greedy internal links

This commit is contained in:
Starbeamrainbowlabs 2018-09-29 23:40:23 +01:00
parent 39098ac0fb
commit c7d7de3d7e
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
5 changed files with 8 additions and 7 deletions

View file

@ -34,6 +34,7 @@ This file holds the changelog for Pepperminty Wiki. This is the master list of t
- Fixed the page history page - it should now display all page revisions in valid HTML
- Fixed another bug in the search context generator
- Display an ellipsis at the beginning of a search context if it doesn't start at the beginning of a page
- Semicolons are no longer automatically included in greedy internal links.
## Changed
- Password hashing has been overhauled! A totally new-and-different system is being used now, so you'll need to rehash all your passwords.

View file

@ -407,7 +407,7 @@ if($settings->sessionprefix == "auto")
/////////////////////////////////////////////////////////////////////////////
/** The version of Pepperminty Wiki currently running. */
$version = "v0.17-dev";
$commit = "24775724d14520b8007cf7f4cc0c1d8901980494";
$commit = "39098ac0fb92b0c206f6b3dcdf635c6cf15f110a";
/// Environment ///
/** Holds information about the current request environment. */
$env = new stdClass();
@ -4892,8 +4892,8 @@ class search
{
if(in_array($qterm, static::$stop_words))
continue;
// From http://stackoverflow.com/a/2483859/1460422
// From http://stackoverflow.com/a/2483859/1460422
$context = preg_replace("/" . preg_replace('/\\//u', "\/", preg_quote($qterm)) . "/iu", "<strong class='search-term-highlight'>$0</strong>", $context);
}
@ -9106,7 +9106,7 @@ class PeppermintParsedown extends ParsedownExtra
{
global $pageindex, $env;
if(preg_match('/^\[\[([^\]]*)\]\]([^\s!?",.()\[\]{}*=+\/]*)/u', $fragment["text"], $matches))
if(preg_match('/^\[\[([^\]]*)\]\]([^\s!?",;.()\[\]{}*=+\/]*)/u', $fragment["text"], $matches))
{
$linkPage = trim($matches[1]);
$display = $linkPage . trim($matches[2]);

View file

@ -104,7 +104,7 @@
"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.",
"id": "feature-search",
"lastupdate": 1538224279,
"lastupdate": 1538236301,
"optional": false
},
{
@ -275,7 +275,7 @@
"author": "Emanuil Rusev & Starbeamrainbowlabs",
"description": "An upgraded (now default!) parser based on Emanuil Rusev's Parsedown Extra PHP library (https:\/\/github.com\/erusev\/parsedown-extra), which is licensed MIT. Please be careful, as this module adds some weight to your installation, and also *requires* write access to the disk on first load.",
"id": "parser-parsedown",
"lastupdate": 1530474936,
"lastupdate": 1538260745,
"optional": false
}
]

View file

@ -1013,8 +1013,8 @@ class search
{
if(in_array($qterm, static::$stop_words))
continue;
// From http://stackoverflow.com/a/2483859/1460422
// From http://stackoverflow.com/a/2483859/1460422
$context = preg_replace("/" . preg_replace('/\\//u', "\/", preg_quote($qterm)) . "/iu", "<strong class='search-term-highlight'>$0</strong>", $context);
}

View file

@ -449,7 +449,7 @@ class PeppermintParsedown extends ParsedownExtra
{
global $pageindex, $env;
if(preg_match('/^\[\[([^\]]*)\]\]([^\s!?",.()\[\]{}*=+\/]*)/u', $fragment["text"], $matches))
if(preg_match('/^\[\[([^\]]*)\]\]([^\s!?",;.()\[\]{}*=+\/]*)/u', $fragment["text"], $matches))
{
$linkPage = trim($matches[1]);
$display = $linkPage . trim($matches[2]);