Ticket #352: cap_ticket352.patch
| File cap_ticket352.patch, 3.7 KB (added by daniel, 4 years ago) |
|---|
-
trac/util.py
56 56 out.write ('</select>') 57 57 return out.getvalue() 58 58 59 def wiki_escape_newline(text): 60 text = text.replace(os.linesep, '[[BR]]') 61 return text 62 59 63 def escape(text): 60 64 """Escapes &, <, > and \"""" 61 65 if not text: … … 156 160 def shorten_line(text, maxlen = 75): 157 161 if not text: 158 162 return '' 159 if len(text) < maxlen: 163 i = text.find('[[BR]]') 164 if i < maxlen: 165 shortline = text[:i]+' ...' 166 elif len(text) < maxlen: 160 167 shortline = text 161 168 else: 162 169 i = text[:maxlen].rfind(' ') -
trac/File.py
252 252 svn.core.SVN_PROP_REVISION_AUTHOR, self.pool) 253 253 msg = svn.fs.revision_prop(self.fs_ptr, rev, 254 254 svn.core.SVN_PROP_REVISION_LOG, self.pool) 255 msg_html = wiki_to_html( msg, self.req.hdf, self.env)255 msg_html = wiki_to_html(util.wiki_escape_newline(msg), self.req.hdf, self.env) 256 256 date = svn.fs.revision_prop(self.fs_ptr, rev, 257 257 svn.core.SVN_PROP_REVISION_DATE, self.pool) 258 258 sdate = util.svn_date_to_string(date, self.pool) -
trac/Log.py
40 40 if change.copyfrom_path: 41 41 self.branch_info[rev] = (change.copyfrom_path, newpath) 42 42 43 shortlog = shorten_line( log)43 shortlog = shorten_line(wiki_escape_newline(log)) 44 44 t = util.svn_time_from_cstring(date, pool) / 1000000 45 45 gmt = time.gmtime(t) 46 46 item = { … … 49 49 'date' : svn_date_to_string (date, pool), 50 50 'gmt' : time.strftime('%a, %d %b %Y %H:%M:%S GMT', gmt), 51 51 'log.raw' : escape(log), 52 'log' : wiki_to_oneliner( log, self.req.hdf, self.env),52 'log' : wiki_to_oneliner(shorten_line(wiki_escape_newline(log)), self.req.hdf, self.env), 53 53 'shortlog' : escape(shortlog), 54 54 'file_href': self.env.href.browser(self.path, rev), 55 55 'changeset_href': self.env.href.changeset(rev) -
trac/Changeset.py
263 263 author = changeset_info['author'] or 'None' 264 264 self.req.hdf.setValue('changeset.author', escape(author)) 265 265 self.req.hdf.setValue('changeset.message', 266 wiki_to_html( changeset_info['message'],266 wiki_to_html(wiki_escape_newline(changeset_info['message']), 267 267 self.req.hdf, self.env)) 268 268 self.req.hdf.setValue('changeset.revision', str(self.rev)) 269 269 add_dictlist_to_hdf(change_info, self.req.hdf, 'changeset.changes') -
trac/Browser.py
92 92 'age' : pretty_age(date_seconds), 93 93 'is_dir' : is_dir, 94 94 'author' : author, 95 'change' : wiki_to_oneliner(shorten_line( change),95 'change' : wiki_to_oneliner(shorten_line(wiki_escape_newline(change)), 96 96 self.req.hdf, self.env) 97 97 } 98 98 if rev_specified:
