Modify ↓
#13196 closed defect (fixed)
Link tags in RSS feed mangled on Trac 1.3.6
Reported by: | Owned by: | Jun Omae | |
---|---|---|---|
Priority: | normal | Milestone: | 1.4.1 |
Component: | rendering | Version: | 1.3.6 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: |
Fixed malformed content of RSS feed when Genshi stream filters exist. |
||
API Changes: | |||
Internal Changes: |
Description
When this plugin is enabled, the RSS feed is malformed, in that the link tags are botched. See our timeline RSS feed for an example.
We are using the trunk module, revision r17015.
Attachments (0)
Change History (8)
comment:1 by , 5 years ago
Milestone: | → plugin - spam-filter |
---|
comment:3 by , 5 years ago
Milestone: | plugin - spam-filter → 1.4.1 |
---|
Root cause is that Trac core uses genshi.input.HTML
to generate a genshi.core.Stream
instance for an XML content. Instead, we should use genshi.input.XML
for.
-
trac/web/chrome.py
diff --git a/trac/web/chrome.py b/trac/web/chrome.py index 1bbb5f665..b29d580fd 100644
a b from trac.util.html import genshi 38 38 if genshi: 39 39 from genshi.core import Attrs, START 40 40 from genshi.filters import Translator 41 from genshi.input import HTML 41 from genshi.input import HTML, XML 42 42 from genshi.output import DocType 43 43 from genshi.template import TemplateLoader, MarkupTemplate, NewTextTemplate 44 44 … … class Chrome(Component): 1938 1938 def _filter_jinja_page(self, req, content, method, filename, 1939 1939 content_type, data, fragment, iterable): 1940 1940 doctype = self.html_doctype if content_type == 'text/html' else None 1941 stream = HTML(content) 1941 stream = HTML(content) if method != 'xml' else XML(content) 1942 1942 stream |= self._filter_stream(req, method, filename, data) 1943 1943 if fragment: 1944 1944 return stream
TODO
- Add unit tests.
- Check the behavior of
_filter_jinja_page()
for text templates.
comment:6 by , 5 years ago
Owner: | changed from | to
---|---|
Release Notes: | modified (diff) |
Status: | new → assigned |
Thanks for the reviewing. Committed in [17145].
comment:7 by , 5 years ago
Resolution: | → fixed |
---|---|
Status: | assigned → closed |
comment:8 by , 5 years ago
Component: | plugin/spamfilter → rendering |
---|
Note:
See TracTickets
for help on using tickets.
Work around:
tracspamfilter/filters/trapfield.py
I think the plugin for 1.4-stable should be created.