Commit graph

15 commits

Author SHA1 Message Date
Yorhel
8e5fa1e165 www: Include .so mans if found in the same package
Unfortunately, this can lead to slightly confusing scenarios, because
the exact package of the displayed man page is not very well defined.
It's possible that, when browsing from a package listing to a man page,
you may see an included file that does not come from the package you
browsed from.
E.g. https://manned.org/pwrite/5f2909f6 - that man page simply includes
pread.2, but from the URL it's unclear from which package or system it
should be included.

The only way to fix this is to add the package ID to the link format.
2017-02-26 08:52:23 +01:00
Yorhel
746889851c A few more HTML conversion improvements
- Fix segfault on empty output (bug was in XS code)
- Still better end-of-URL detection
- Recognize a few common multicharacter sections in man references
2017-01-15 20:27:16 +01:00
Yorhel
6114b17389 Experimental rewrite of grotty to html conversion in Rust
The previous C code was troublesome.
- Didn't handle long lines
- I couldn't convince myself that it was free of memory safety issues
- Needed improving anyway, there are some formatting bugs. These are
  hard to fix in the current code.

I mostly replicated the formatting bugs of the old C implementation in
Rust, and possibly added a few new bugs as well. It's not a significant
improvement right now, more testing and fixing will be needed.

The performance of both implementations is comparable, with the Rust
version being slightly faster in many cases (and slower in some others).
I did spend more time trying to optimize this Rust version than I did
with the old C code. I initially tried a naive-ish conversion of the C
code to Rust, but that turned out to be much slower and I had to resort
to using regexes and different data structures fix that.
2017-01-15 12:17:34 +01:00
Yorhel
a7352d27b9 Fix possible wrapping of MANNEDINCLUDE by removing space
This doesn't really guarantee that it won't wrap, but fixes at least one
man page.

- https://manned.org/BlockSelectionDCOPInterface/6dfdf921
2016-10-16 10:28:44 +02:00
Yorhel
17fc298217 Fix handling of URLs ending in a ⟩
I've known about this issue before, but didn't realize it was so
widespread. This fixes many links.
2016-10-16 09:11:15 +02:00
Yorhel
2da67d585c Various changes/fixes, 3 new distro versions 2015-04-28 08:27:29 +02:00
Yorhel
17476b5b54 Fix MANNEDINCLUDE formatting on e.g. zshall.1 2014-09-25 09:22:48 +02:00
Yorhel
a897c572ab ManUtils: Disable printing of warnings 2013-08-21 13:21:08 +02:00
Yorhel
f30c372f51 Decrease formatted man page size to 80 columns
I've found 90 to be a tiny bit too wide - it makes the contents overlap
with the selection box in not-very-wide windows.
2013-04-27 07:15:41 +02:00
Yorhel
91c1367923 ManUtils: Widen rendered man page to 90 columns
Looks slightly less cramped.
2012-07-17 21:38:43 +02:00
Yorhel
53857d5b84 ManUtils: Fix XSS vulnerability and rendering bug in URL formatting
The characters <>" are now simply not allowed in URLs. Incidentally,
this also fixes formatting of some URLs within brackets, e.g.
<http://blicky.net/>.
2012-07-17 21:24:55 +02:00
Yorhel
147e76d405 ManUtils: Fix render issues when grog detects multiple macro packages 2012-07-11 14:29:15 +02:00
Yorhel
eb3e6cf929 ManUtils: Fix display of double-formatted characters
Grotty outputs double-formatted characters for some (old) manual pages.
This fix ignores the second part of the double-formatting, thus making
things readable again.
2012-07-11 13:53:35 +02:00
Yorhel
5f87ab9069 Rewrote manfmt to use AnyEvent and moved it to ManUtils 2012-07-11 11:33:12 +02:00
Yorhel
fadb0a1110 s/GrottyParser/ManUtils/g 2012-07-11 11:29:15 +02:00