mirror of
https://github.com/vichan-devel/vichan.git
synced 2025-02-21 13:09:41 +01:00
Fix \t in posts (editing posts, and HTML Tidy)
This commit is contained in:
parent
f1b1d41230
commit
d166fc70bd
@ -1580,9 +1580,6 @@ function markup(&$body, $track_cites = false) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// replace tabs with 8 spaces
|
|
||||||
$body = str_replace("\t", ' ', $body);
|
|
||||||
|
|
||||||
$tracked_cites = array();
|
$tracked_cites = array();
|
||||||
|
|
||||||
// Cites
|
// Cites
|
||||||
@ -1748,6 +1745,7 @@ function markup(&$body, $track_cites = false) {
|
|||||||
|
|
||||||
if ($config['markup_repair_tidy']) {
|
if ($config['markup_repair_tidy']) {
|
||||||
$tidy = new tidy();
|
$tidy = new tidy();
|
||||||
|
$body = str_replace("\t", '	', $body);
|
||||||
$body = $tidy->repairString($body, array(
|
$body = $tidy->repairString($body, array(
|
||||||
'doctype' => 'omit',
|
'doctype' => 'omit',
|
||||||
'bare' => true,
|
'bare' => true,
|
||||||
@ -1759,10 +1757,12 @@ function markup(&$body, $track_cites = false) {
|
|||||||
'output-html' => true,
|
'output-html' => true,
|
||||||
'newline' => 'LF',
|
'newline' => 'LF',
|
||||||
'quiet' => true,
|
'quiet' => true,
|
||||||
|
|
||||||
), 'utf8');
|
), 'utf8');
|
||||||
$body = str_replace("\n", '', $body);
|
$body = str_replace("\n", '', $body);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// replace tabs with 8 spaces
|
||||||
|
$body = str_replace("\t", ' ', $body);
|
||||||
|
|
||||||
return $tracked_cites;
|
return $tracked_cites;
|
||||||
}
|
}
|
||||||
|
@ -1317,6 +1317,8 @@ function mod_edit_post($board, $edit_raw_html, $postID) {
|
|||||||
$post['body'] = str_replace("\n", '
', utf8tohtml($post['body']));
|
$post['body'] = str_replace("\n", '
', utf8tohtml($post['body']));
|
||||||
$post['body_nomarkup'] = str_replace("\r", '', $post['body_nomarkup']);
|
$post['body_nomarkup'] = str_replace("\r", '', $post['body_nomarkup']);
|
||||||
$post['body'] = str_replace("\r", '', $post['body']);
|
$post['body'] = str_replace("\r", '', $post['body']);
|
||||||
|
$post['body_nomarkup'] = str_replace("\t", '	', $post['body_nomarkup']);
|
||||||
|
$post['body'] = str_replace("\t", '	', $post['body']);
|
||||||
}
|
}
|
||||||
|
|
||||||
mod_page(_('Edit post'), 'mod/edit_post_form.html', array('token' => $security_token, 'board' => $board, 'raw' => $edit_raw_html, 'post' => $post));
|
mod_page(_('Edit post'), 'mod/edit_post_form.html', array('token' => $security_token, 'board' => $board, 'raw' => $edit_raw_html, 'post' => $post));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user