This commit completely overhauls the heading navigation feature (d/shift+D keys)
to use actual HTML tag information instead of unreliable text-based heuristics.
Key improvements:
- Navigation now works 100% reliably by tracking actual <h1>-<h6> HTML tags
- Eliminates false positives from bold text, links, and buttons
- No longer navigates to blank lines around headings
- Provides true screen reader-style heading navigation
Technical implementation:
- Added LINE_FLAG_HEADING flag to mark heading lines during HTML processing
- Enhanced readbuffer with in_heading field to track heading tag state
- Modified HTML parser to set/clear heading flags on <h>/<\/h> tags
- Updated TextLine and Line structures to preserve heading information
- Simplified navigation functions to use reliable flag-based detection
- Added content length check to avoid marking blank spacing lines
Also includes compilation fixes for modern GCC:
- Fixed function pointer type compatibility issues
- Updated signal handler declarations
- Resolved deprecation warnings for various system calls
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <noreply@anthropic.com>
With this patch applied the user can configure a directory to store
temporary/cache files. The history and cookies remain in RC_DIR.
I suppose the intent of writing the history to a temp file first is to
make the actual write an atomic operation. As rename() does not work
across mount points, we need to handle the temp file for the history
different to keep this behaviour.
Add a new type for the temp history file and handle this case different
when creating a temp file.
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.
Also changes the behaviour of conv_entity() to convert left/right quotes and some dashes because named entities are needed for the new code for the q tag.
Since Google gives usable search results to Lynx but not to w3m, and
many other sites block Lynx but /not/ w3m, we want to be able to set
the User Agent string on a per-site basis.
Adding on command line the user agent add a duplicate header:
```
./w3m -header "User-Agent: Mozilla" http://localhost:9999
GET / HTTP/1.0
User-Agent: w3m/0.5.3+git20190105
Accept: text/html, text/*;q=0.5, image/*, application/*, message/*, x-scheme-handler/*, audio/*, video/*, inode/*
Accept-Encoding: gzip, compress, bzip, bzip2, deflate
Accept-Language: en;q=1.0
Host: localhost:9999
Pragma: no-cache
Cache-control: no-cache
User-Agent: Mozilla
```
As a result most server will take the first given; the default
w3m_version or the one defined on config `user_agent`
With this patch we can now override `User-Agent` from command line
Patch from upstream, [w3m-dev 04411] on 2010-09-17, to support the
button element. It is discussed upstream and incomplete, but enough
to login Launchpad.