changeset 1966:44570fb9d7c8

text_moin_wiki:fixed inline bug should be used for major mimetype text only
author Reimar Bauer <rb.proj AT googlemail DOT com>
date Sun, 08 Apr 2007 19:31:12 +0000
parents 388f477fd536
children 3bc30cdc4555
files MoinMoin/parser/text_moin_wiki.py
diffstat 1 files changed, 3 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/parser/text_moin_wiki.py	Sun Apr 08 20:55:29 2007 +0200
+++ b/MoinMoin/parser/text_moin_wiki.py	Sun Apr 08 19:31:12 2007 +0000
@@ -220,8 +220,9 @@
         if not kw.get('pretty_url', 0) and wikiutil.isPicture(fname):
             return self.formatter.attachment_image(fname)
 
-        # inline the attachment
-        if scheme == 'inline':
+        # inline the attachment if it's major mimetype is text
+        mt = wikiutil.MimeType(filename=fname)
+        if scheme == 'inline' and mt.major == 'text':
             return self.formatter.attachment_inlined(fname, text)
 
         return self.formatter.attachment_link(fname, text)