Skip to content

Commit

Permalink
Merge pull request #527 from discomrade/regex-open-bracket
Browse files Browse the repository at this point in the history
Allow open parentheses before cite: "(>>1"
  • Loading branch information
basedgentoo authored Apr 24, 2023
2 parents 417406d + 5d31f3b commit 8012cc5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions inc/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2086,7 +2086,7 @@ function markup(&$body, $track_cites = false, $op = false) {
$tracked_cites = array();

// Cites
if (isset($board) && preg_match_all('/(^|\s)>>(\d+?)((?=[\s,.)?!])|$)/m', $body, $cites, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) {
if (isset($board) && preg_match_all('/(^|[\s(])>>(\d+?)((?=[\s,.)?!])|$)/m', $body, $cites, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) {
if (count($cites[0]) > $config['max_cites']) {
error($config['error']['toomanycites']);
}
Expand Down Expand Up @@ -2133,7 +2133,7 @@ function markup(&$body, $track_cites = false, $op = false) {
}

// Cross-board linking
if (preg_match_all('/(^|\s)>>>\/(' . $config['board_regex'] . 'f?)\/(\d+)?((?=[\s,.)?!])|$)/um', $body, $cites, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) {
if (preg_match_all('/(^|[\s(])>>>\/(' . $config['board_regex'] . 'f?)\/(\d+)?((?=[\s,.)?!])|$)/um', $body, $cites, PREG_SET_ORDER | PREG_OFFSET_CAPTURE)) {
if (count($cites[0]) > $config['max_cites']) {
error($config['error']['toomanycross']);
}
Expand Down

0 comments on commit 8012cc5

Please sign in to comment.