jerone / UserScripts

🐵 My UserScripts
https://github.com/jerone/UserScripts#readme
GNU General Public License v3.0
339 stars 39 forks source link

(GitHub Reply Comments) doesn't handle embedded references to code #144

Closed aspiers closed 5 years ago

aspiers commented 5 years ago

For example, if I include a permalink to a code fragment in this repo:

https://github.com/jerone/UserScripts/blob/e60d4c1bd289e56273b4a19a146ca991ad3eba78/Github_Reply_Comments/Github_Reply_Comments.user.js#L24

and you try replying to this, ~you'll see a large chunk of HTML which GitHub expanded itself.~ ... Hrm weird, that didn't reproduce it, but I saw it when replying to this.

jerone commented 5 years ago

Thanks for reporting, I can confirm this issue. My initial research shows that it's hard to detect when a code fragment is used, but I have some ideas. I'm currently in the process of rewriting the MarkDown part, to better support all different tags.

This issue is only reproducible on comments that are not your own and comments not in repos where you have admin permissions to.

jerone commented 5 years ago

@aspiers commented on Jan 30, 2019, 11:10 AM GMT+1:

For example, if I include a permalink to a code fragment in this repo:

https://github.com/jerone/UserScripts/blob/e60d4c1bd289e56273b4a19a146ca991ad3eba78/Github_Reply_Comments/Github_Reply_Comments.user.js#L24

and you try replying to this, ~you'll see a large chunk of HTML which GitHub expanded itself.~ ... Hrm weird, that didn't reproduce it, but I saw it when replying to this.

As you can see above, I just fixed the issue where it wouldn't recognize GitHub code snippets. You can install the new version here: https://github.com/jerone/UserScripts/tree/master/Github_Reply_Comments or wait for the external sites (Greasy Fork & OpenUserJS) to synchronize.

Thanks for reporting, it was an interesting issue 😄

aspiers commented 5 years ago

Fantastic work, thanks a lot!