Skip to content
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

HTML escaping in atom feed #110

Open
pschirmacher opened this issue Nov 19, 2014 · 7 comments
Open

HTML escaping in atom feed #110

pschirmacher opened this issue Nov 19, 2014 · 7 comments
Labels

Comments

@pschirmacher
Copy link
Contributor

This looks weird:

@<a href='/statuses/updates?author=st'& gt;st</a> /me is in love the simple things! But there's an issue with placing the cursor in the input field on iOS - the text doesn't scroll!

https://github.com/innoq/statuses/blob/master/src/statuses/views/atom.clj#L26 ?

@aheusingfeld
Copy link
Contributor

As written in innoq/naveed#13 (comment), AFAIR an atom feed is supposed to contain xml entities. In this case feedworker should behave like a RSS reader and decode them.

@pschirmacher
Copy link
Contributor Author

Good point.

Statuses sends content with type HTML: <content type="html">@&lt;a href=&apos;/statuses/updates?author=st&apos;&gt;st&lt;/a&gt; <U+1F60A> /me is in love the simple things! But there&amp;apos;s an issue

For HTML escaping, it uses this function: https://github.com/weavejester/hiccup/blob/master/src/hiccup/util.clj#L55 which encodes ' as &apos;. Apparently, &apos; is not defined in HTML 4 and e.g. commons-lang3 does not unescape it. Not sure if this warrants any change in statuses, just wanted to mention it.

I'll adapt the feed processor accordingly.

@mvitz mvitz added the question label Nov 25, 2014
@mvitz
Copy link
Contributor

mvitz commented Nov 25, 2014

Have we agreed that escaping is the right thing to do? If yes I will close this issue as won't fix.

@pschirmacher
Copy link
Contributor Author

IMHO escaping is the right thing to do. The only question is whether or not to encode ' as &apos;.

@mvitz
Copy link
Contributor

mvitz commented Nov 25, 2014

Text escaping in XML is defined as: http://www.w3.org/TR/xml/#syntax

@aheusingfeld
Copy link
Contributor

The only question is whether or not to encode ' as '.

FWIW I noticed that these chars are also encoded in the HTML the app returns! :(

@mvitz
Copy link
Contributor

mvitz commented Nov 25, 2014

It seems in HTML5 escaping ' and " is allowed (see: http://www.w3.org/International/questions/qa-escapes and http://www.tutorialspoint.com/html5/html5_entities.htm).
However they give the hint that &apos; is not supported in HTML4 and older browsers. Maybe we just escape these as &#39;?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants