forked from GithubBackups/vichan
Merge pull request #931 from Zankaria/cross-strikethrough
Crossboard strikethrough for invalid cites
This commit is contained in:
commit
6a44f6f544
@ -2063,21 +2063,24 @@ 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>>>>/$_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] . '">' .
|
||||||
'>>>/' . $_board . '/' .
|
'>>>/' . $_board . '/' .
|
||||||
'</a>';
|
'</a>';
|
||||||
|
} else {
|
||||||
|
$replacement = "<s>>>>/$_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]));
|
$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]);
|
$skip_chars += mb_strlen($matches[1][0] . $replacement . $matches[4][0]) - mb_strlen($matches[0][0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
$tracked_cites = array_unique($tracked_cites, SORT_REGULAR);
|
$tracked_cites = array_unique($tracked_cites, SORT_REGULAR);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user