-
-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No CDATA block in content block of atom feed #7
Comments
@av3 Example: $tidy = new \tidy;
$tidy->parseString(
'<p><img src="foo.jpg"></p>',
[
'output-xhtml' => true,
'show-body-only' => true,
'quote-nbsp' => false,
]
);
$tidy->cleanRepair();
var_dump((string) $tidy); // <p><img src="foo.jpg" /></p> Originally posted by @froschdesign at zendframework/zend-feed#82 (comment) |
Thanks for your reply, @froschdesign. With Tidy it's working, even if it's not very beautiful: <content xmlns:xhtml="http://www.w3.org/1999/xhtml" type="xhtml">
<xhtml:div xmlns:xhtml="http://www.w3.org/1999/xhtml"><xhtml:img src="myimage" />
<xhtml:p>My content</xhtml:p>
</xhtml:div>
</content> But is this really necessary? Wouldn't it be better to use But this would also mean that the atom output example of the documentation is wrong, right? If I don't want that xhtml output: Would it be possible to write an own Writer Extension where I could overwrite the _setContent method? Are there any examples how to register own Writers? In the documentation there is just a "TODO" for that chapter. Originally posted by @av3 at zendframework/zend-feed#82 (comment) |
Why isn't it beautiful? The generated code works and is correct.
The content of
Right!
Oh, this is a mistake. Thanks for the hint! Originally posted by @froschdesign at zendframework/zend-feed#82 (comment) |
Please have a look at zend-feed also provides an extension for this element: The usage of the writer extensions are the same like described for the reader: https://docs.zendframework.com/zend-feed/reader/#extending-feed-and-entry-apis Originally posted by @froschdesign at zendframework/zend-feed#82 (comment) |
Yes, (meanwhile) I know that it's correct with the XHTML. It looks unusual for me and I thought it could be better to provide the content without modification (faster and smaller size), but this isn't important for a feed.
There it says:
and in description it says:
No word about xhtml content, but I know that it's also a valid solution for Atom feeds. But when it says "same manner as the description element" and the
But this works only for RSS feeds, not for Atom.
Thank you, but unfortunately I wasn't successful with this. Writing my own Renderer\Entry with a I addition to this I tried to write my own extension to optimize my feed for feedly. I tried to start with my own Writer\Feed class and add methods for an accentColor and registering the namespace. But there is no
Next attempt: Without an
I don't know why it's checking for a method of the iTunes extension in my own extension. But okay, this is another problem. Maybe you (or someone else) could provide an "JungleBooks" extension example for the Writer in the documentation. Originally posted by @av3 at zendframework/zend-feed#82 (comment) |
Sorry, the topic was Atom and not RSS. My mistake. 🤦♂️
See at the specification: https://tools.ietf.org/html/rfc4287#page-14
Maybe tomorrow. I will definitely give feedback. Originally posted by @froschdesign at zendframework/zend-feed#82 (comment) |
@av3 Originally posted by @froschdesign at zendframework/zend-feed#82 (comment) |
Hello,
I wanted to provide feeds (via the Writer of Zend Feed) with the full content of an article (including some HTML5 markup) and thought to prefer atom over rss. But the writer is acting different and causes some trouble for me.
My code:
Output for RSS:
Output for Atom:
And if I add any image to it in HTML5-Style
<img src="myimage.jpg">
instead of XHTML-Style<img src="myimage.jpg" />
, I get a warning:In the atom example in the documentation there is the output:
In _setDescription I found
$dom->createCDATASection
(Entry\Rss and Entry\Atom). But in Atom it's just the summary and in Rss the Content.In Entry\Atom the _setContent is relevant for the content block, which I wanted to use to output the full content and not just a summary. And there I found
$element->setAttribute('type', 'xhtml')
in _setContent.I doubt that the atom output of the example in the documentation is even possible with Zend Feed or am I wrong? It would be great, if the atom feed would also use the CDATA blockinstead of the xhtml for the content.
Originally posted by @av3 at zendframework/zend-feed#82
The text was updated successfully, but these errors were encountered: