1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

SMJS: mangle_deb_bugnumbers: add <pre>; set rendered view

Use the newly available view_state object to change to rendered view
and wrap everything in <pre> ... </pre> if the document MIME type is
text/plain.
This commit is contained in:
Miciah Dashiel Butler Masters 2006-01-28 03:27:41 +00:00 committed by Miciah Dashiel Butler Masters
parent 495fb2805b
commit 2e9d433402

View File

@ -55,7 +55,14 @@ function mangle_deb_bugnumbers(cached, vs) {
/* Debian Policy Manual 4.4 footnote 16 */
var closes_re = /closes:\s*(?:bug)?\#?\s?\d+(?:,\s*(?:bug)?\#?\s?\d+)*/gi;
cached.content = cached.content.replace(closes_re, rewrite_closes_fn);
var new_content = cached.content.replace(closes_re, rewrite_closes_fn);
if (cached.content_type == 'text/plain') {
cached.content = '<pre>' + new_content + '</pre>';
vs.plain = "0";
} else {
cached.content = new_content;
}
return true;
}