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

Offline Reading <> Invalidates HTML #4

Closed
WAUthethird opened this issue May 2, 2019 · 3 comments
Closed

Offline Reading <> Invalidates HTML #4

WAUthethird opened this issue May 2, 2019 · 3 comments

Comments

@WAUthethird
Copy link

WAUthethird commented May 2, 2019

Hey there, it's me again. When I compile a subreddit using the offline_reading functionality, there always seems to be errors whenever I merge all the files into one (using something like HTML Merge). Specifically, these errors refer to the < and > signs, as HTML uses them quite heavily.

Would it be possible for offline_reading to replace < and > with &lt; and &gt;? These codes do work correctly without errors, and would fix a lot of problems I've been having, along with keeping it WYSIWYG. (it would also help with certain instances, where, for example, someone puts <i into their comment/submission, and the HTML renderer just renders the rest of the entire document italicized)

Thanks!

@voussoir
Copy link
Owner

voussoir commented May 3, 2019

Hey again

Oops, I assumed the markdown library would escape the text content. I'm surprised but it's my fault for not testing that.

I took a look at some options for escaping the text. I saw Python has an html module so I could html.escape the text before running the markdown, but then that breaks html entities which are okay to use like nbsp. So for now let's try just replacing lt and rt and see if that's sufficient.

Commit: 871a56d

Thanks for bringing this up! You may close this issue if that fixes it for you.

@WAUthethird
Copy link
Author

Thanks a lot, that works perfectly!

@WAUthethird
Copy link
Author

WAUthethird commented May 3, 2019

Mainly it's just unsupported encoding errors causing any problems now - none caused by this software, of course. Amazon links seem to be the most troublesome when it comes to this, but it's not too hard of a fix.

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

No branches or pull requests

2 participants