From 2e9d433402d44eafa1630e10760b2635a5d6072b Mon Sep 17 00:00:00 2001 From: Miciah Dashiel Butler Masters Date: Sat, 28 Jan 2006 03:27:41 +0000 Subject: [PATCH] SMJS: mangle_deb_bugnumbers: add
; set rendered view

Use the newly available view_state object to change to rendered view
and wrap everything in 
 ... 
if the document MIME type is text/plain. --- contrib/smjs/hooks.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/contrib/smjs/hooks.js b/contrib/smjs/hooks.js index d4516c715..0278e46f2 100644 --- a/contrib/smjs/hooks.js +++ b/contrib/smjs/hooks.js @@ -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 = '
' + new_content + '
'; + vs.plain = "0"; + } else { + cached.content = new_content; + } + return true; }