From 8b858f2fcce4f22c1be793aef18352818bd0d19b Mon Sep 17 00:00:00 2001 From: Mahmoud Al-Qudsi Date: Tue, 26 Sep 2017 13:34:23 -0500 Subject: [PATCH] Use a custom Lynx style sheet (LSS file) to work around Lynx bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Lynx uses a very naïve method of applying styles to HTML elements by hashing the element type and the class name to generate a map of hash:style. After the hash is calculated, Lynx does not go back and check whether or not the actual string values match the LSS properties. See the following links on the Links mailing list: * http://lists.gnu.org/archive/html/lynx-dev/2015-12/msg00037.html * http://lists.gnu.org/archive/html/lynx-dev/2015-12/msg00039.html This patch copies the default Lynx stylesheet but removes highlighting and other styles that would result in unreadable text (due to not enough contrast with the background color), and if the `help` builtin detects that the best web browser to use is Lynx, it instructs it to use this modified stylesheet. --- doc_src/lynx.lss | 104 ++++++++++++++++++++++++++++++++++++++ share/functions/help.fish | 6 +++ 2 files changed, 110 insertions(+) create mode 100644 doc_src/lynx.lss diff --git a/doc_src/lynx.lss b/doc_src/lynx.lss new file mode 100644 index 000000000..dcf83f26f --- /dev/null +++ b/doc_src/lynx.lss @@ -0,0 +1,104 @@ +# Lynx Style Sheet +# Used as a custom style sheet (LSS) for the Lynx browser to work around some +# poor defaults. Usage: `lynx -lss=style.lss` +# +# The next line (beginning with "em") means: use bold if mono, otherwise +# brightblue on (implicit) +em:bold:brightblue +strong:bold:brightred +b:bold:red +i:bold:brightblue +a:bold:green +img:dim:brown +fig:normal:gray +caption:reverse:brown +hr:normal:yellow +blockquote:normal:brightblue +ul:normal:brown +address:normal:magenta +title:normal:magenta +tt:dim:brightmagenta:default +h1:bold:yellow +h2:normal:brown +h3:normal:green +h4:normal:cyan +label:normal:magenta +q:normal:yellow +small:dim:default +big:bold:yellow +sup:bold:yellow +sub:dim:gray +lh:bold:yellow +li:normal:magenta +code:normal:cyan +cite:normal:cyan + +table:normal:brightcyan +tr:bold:brown +td:normal:default +br:normal:default + +# Special styles - not corresponding directly to HTML tags +# alert - status bar, when message begins "Alert". +# alink - active link +# normal - default attributes +# status - status bar +# whereis - whereis search target +# +#normal:normal:default:blue +alink:reverse:yellow +status:reverse:yellow +alert:bold:yellow:red +whereis:reverse+underline:magenta +# currently not used +#value:normal:green +#high:bold:brightmagenta +forwbackw.arrow:reverse + +# Styles with classes -