forked from leftypol/leftypol
functions.php: add crossboard strikethrough for invalid cites
This commit is contained in:
parent
f2d0ac7341
commit
439730f216
1 changed files with 7 additions and 5 deletions
|
|
@ -2296,19 +2296,21 @@ function markup(&$body, $track_cites = false) {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$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]);
|
|
||||||
|
|
||||||
if ($track_cites && $config['track_cites'])
|
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>';
|
||||||
$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>>>>/$_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]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue