Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

Character < is being escaped #91

Closed
fedemp opened this issue Apr 16, 2015 · 3 comments
Closed

Character < is being escaped #91

fedemp opened this issue Apr 16, 2015 · 3 comments

Comments

@fedemp
Copy link

fedemp commented Apr 16, 2015

As it says on the title, < is being shown as &lt; even when rtv is not parsing html.

2015-04-16-203759_1284x110_scrot

@michael-lazar
Copy link
Owner

It's working fine for me 😦

Is it every < symbol or just this one? What versions of python / PRAW are you running?

@fedemp
Copy link
Author

fedemp commented Apr 17, 2015

It seems to happen when the < is not marked as code. Not sure if you can open a specific post but if you can, check this two:

http://www.reddit.com/r/vim/comments/2x83tq/navigation_tips/ works fine cause it's written as

`<CR>`

in the post body.

https://www.reddit.com/r/vim/comments/20c0gd/vimdispatch_i_should_have_used_this_years_ago/cg1zsea is the one that is shown in the screen capture.

@michael-lazar
Copy link
Owner

I checked into this, it looks like a typo within reddit's API!

Here's the call that we're making, along with the response:

http://www.reddit.com/r/vim/comments/20c0gd/vimdispatch_i_should_have_used_this_years_ago/cg1zsea.json?sort=hot

[{"kind": "Listing", "data": {"modhash": "yx8rzzd9l45c16425ab7620e596f3156b334bb7b3fa3408026", "children": [{"kind": "t3", "data": {"domain": "tilvim.com", "banned_by": null, "media_embed": {}, "subreddit": "vim", "selftext_html": null, "selftext": "", "likes": null, "user_reports": [], "secure_media": null, "link_flair_text": null, "id": "20c0gd", "gilded": 0, "archived": true, "clicked": false, "report_reasons": null, "author": "jackfranklin", "num_comments": 25, "score": 106, "approved_by": null, "over_18": false, "hidden": false, "thumbnail": "", "subreddit_id": "t5_2qhqx", "edited": false, "link_flair_css_class": null, "author_flair_css_class": null, "downs": 0, "mod_reports": [], "secure_media_embed": {}, "saved": false, "is_self": false, "name": "t3_20c0gd", "permalink": "/r/vim/comments/20c0gd/vimdispatch_i_should_have_used_this_years_ago/", "stickied": false, "created": 1394736699.0, "url": "http://tilvim.com/2014/03/13/dispatch.html", "author_flair_text": null, "title": "vim-dispatch: I should have used this years ago!", "created_utc": 1394733099.0, "ups": 106, "upvote_ratio": 0.98, "media": null, "visited": false, "num_reports": null, "distinguished": null}}], "after": null, "before": null}}, {"kind": "Listing", "data": {"modhash": "yx8rzzd9l45c16425ab7620e596f3156b334bb7b3fa3408026", "children": [{"kind": "t1", "data": {"subreddit_id": "t5_2qhqx", "banned_by": null, "link_id": "t3_20c0gd", "likes": null, "replies": "", "user_reports": [], "saved": false, "id": "cg1zsea", "gilded": 0, "archived": true, "report_reasons": null, "author": "Watabou90", "parent_id": "t1_cg1w8wc", "score": 3, "approved_by": null, "controversiality": 0, "body": "Sure here you go: [vimrc](https://github.com/ajh17/dotfiles/blob/master/.vimrc)\n\nYou can find my .vim/ in there too\n\nEdit: although you won't find a dispatch autocmd, I actually just invoke autocmd lazily, when I need them. I just set my makeprg to whatever I want and then just set 'autocmd bufwritepost * :Dispatch&amp;lt;CR&gt;\n\nI also just set the b:dispatch variable in my ftplugin/ directory so I only need to :Dispatch to check for errors. ", "edited": 1394756155.0, "author_flair_css_class": "", "downs": 0, "body_html": "&lt;div class=\"md\"&gt;&lt;p&gt;Sure here you go: &lt;a href=\"https://github.com/ajh17/dotfiles/blob/master/.vimrc\"&gt;vimrc&lt;/a&gt;&lt;/p&gt;\n\n&lt;p&gt;You can find my .vim/ in there too&lt;/p&gt;\n\n&lt;p&gt;Edit: although you won&amp;#39;t find a dispatch autocmd, I actually just invoke autocmd lazily, when I need them. I just set my makeprg to whatever I want and then just set &amp;#39;autocmd bufwritepost * :Dispatch&amp;lt;CR&amp;gt;&lt;/p&gt;\n\n&lt;p&gt;I also just set the b:dispatch variable in my ftplugin/ directory so I only need to :Dispatch to check for errors. &lt;/p&gt;\n&lt;/div&gt;", "subreddit": "vim", "score_hidden": false, "name": "t1_cg1zsea", "created": 1394755478.0, "author_flair_text": "Vimmy the Pooh", "created_utc": 1394751878.0, "ups": 3, "mod_reports": [], "num_reports": null, "distinguished": null}}], "after": null, "before": null}}]

The relevant part of the response:

I want and then just set 'autocmd bufwritepost * :Dispatch&amp;lt;CR&gt;\n\n

So you can see that the less than symbol is not properly escaped in the response object (&amp;lt; instead of &lt;). I don't see anything that we can do about this on the client end.

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

No branches or pull requests

2 participants