Merge pull request #931 from Zankaria/cross-strikethrough

Crossboard strikethrough for invalid cites
This commit is contained in:
Lorenzo Yario 2025-04-24 23:54:01 -05:00 committed by GitHub
commit 6a44f6f544
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -2063,19 +2063,22 @@ function markup(&$body, $track_cites = false) {
'>>>/' . $_board . '/' . $cite . '>>>/' . $_board . '/' . $cite .
'</a>'; '</a>';
$body = mb_substr_replace($body, $matches[1][0] . $replacement . $matches[4][0], $matches[0][1] + $skip_chars, mb_strlen($matches[0][0])); if ($track_cites && $config['track_cites']) {
$skip_chars += mb_strlen($matches[1][0] . $replacement . $matches[4][0]) - mb_strlen($matches[0][0]);
if ($track_cites && $config['track_cites'])
$tracked_cites[] = array($_board, $cite); $tracked_cites[] = array($_board, $cite);
}
} else {
$replacement = "<s>&gt;&gt;&gt;/$_board/$cite</s>";
} }
} elseif(isset($crossboard_indexes[$_board])) { } elseif(isset($crossboard_indexes[$_board])) {
$replacement = '<a href="' . $crossboard_indexes[$_board] . '">' . $replacement = '<a href="' . $crossboard_indexes[$_board] . '">' .
'&gt;&gt;&gt;/' . $_board . '/' . '&gt;&gt;&gt;/' . $_board . '/' .
'</a>'; '</a>';
$body = mb_substr_replace($body, $matches[1][0] . $replacement . $matches[4][0], $matches[0][1] + $skip_chars, mb_strlen($matches[0][0])); } else {
$skip_chars += mb_strlen($matches[1][0] . $replacement . $matches[4][0]) - mb_strlen($matches[0][0]); $replacement = "<s>&gt;&gt;&gt;/$_board/$cite</s>";
} }
$body = mb_substr_replace($body, $matches[1][0] . $replacement . $matches[4][0], $matches[0][1] + $skip_chars, mb_strlen($matches[0][0]));
$skip_chars += mb_strlen($matches[1][0] . $replacement . $matches[4][0]) - mb_strlen($matches[0][0]);
} }
} }