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

Allow way for hoooks like pre_format_html_hook to know the content-type or other headers before deciding how to rewrite HTML (or non-HTML) #356

Open
Moult opened this issue Jan 7, 2025 · 6 comments

Comments

@Moult
Copy link
Contributor

Moult commented Jan 7, 2025

Visit https://au.hardfought.org/userdata/M/Moult/nethack/dumplog/1734863710.nh.txt and you'll see the <-- You were here text appear like this: &lt;- You were here.

@Moult
Copy link
Contributor Author

Moult commented Jan 7, 2025

Interesting, inversely if you visit https://github.com/rkd77/elinks/issues/356 (i.e. this bugreport) I see this:

2025-01-08-103341_941x92_scrot

2025-01-08-103355_822x60_scrot

@rkd77
Copy link
Owner

rkd77 commented Jan 8, 2025

Cannot reproduce it. I can see Level 51: <- You were here. without entities.

@Moult
Copy link
Contributor Author

Moult commented Jan 8, 2025 via email

@rkd77
Copy link
Owner

rkd77 commented Jan 9, 2025

AFAIK, there is no such feature. There was an idea to read headers as API call, and set arbitrary headers as another API call, but no code yet.

@Moult Moult changed the title HTML escaping occurs in txt file Allow way for hoooks like pre_format_html_hook to know the content-type or other headers before deciding how to rewrite HTML (or non-HTML) Jan 9, 2025
@Moult
Copy link
Contributor Author

Moult commented Jan 9, 2025

OK I added this as a temporary workaround:

if url.endswith("txt"):
    return html

However what about this inverse issue? #356 (comment)

rkd77 added a commit that referenced this issue Jan 9, 2025
@rkd77
Copy link
Owner

rkd77 commented Jan 9, 2025

Yes, libdom converted &amp; to & and old elinks renderer converted concatenated generated & and lt; as <.
Added workaround. Check now.

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