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

Patch to make w3m’s handling of the a element HTML5 compatible (when the stream is HTML5) #146

Merged
merged 1 commit into from
Aug 30, 2020

Conversation

acli
Copy link
Contributor

@acli acli commented Aug 25, 2020

In HTML5 anchors should not be closed when encountering divs, for example, but should be closed when encountering buttons, for example. Many sites that use HTML5-style anchors end up having links displayed with zero-length link texts. The proposed patch corrects this behaviour by detecting whether the document is HTML5, then suppressing the close-anchor action in CLOSE_A if it’s an HTML5 document. A new macro handles the HTML5-specific cases where anchors are not already always closed.

This also fixes a bug in the tokenizer in etc.c that prevented the !doctype element from being recognized; the fix is necessary because HTML5 detection depends on checking the !doctype element.

…mple, but should be closed when encountering buttons, for example. Many sites that use HTML5-style anchors end up having links displayed with zero-length link texts. The proposed patch correct this behaviour by detecting whether the document is HTML5, then suppressing the close-anchor action in CLOSE_A if it's an HTML5 document. A new macro handles the HTML5-specific cases where anchors are not already always closed.

This also fixes a bug in the tokenizing FSM in etc.c that prevented the !doctype element from being recognized; the fix is necessary because HTML5 detection depends on checking the !doctype element.
@tats tats merged commit 6339dd9 into tats:master Aug 30, 2020
@tats
Copy link
Owner

tats commented Aug 30, 2020

Merged. Thanks for your contribution.

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

Successfully merging this pull request may close these issues.

None yet

2 participants