Skip to content

Instantly share code, notes, and snippets.

@deton
Created December 31, 2022 03:42
Show Gist options
  • Save deton/a5be0c47d28024cd49b823406ec88127 to your computer and use it in GitHub Desktop.
Save deton/a5be0c47d28024cd49b823406ec88127 to your computer and use it in GitHub Desktop.
Lynx patch to disable toolbar
diff --git a/src/HTML.c b/src/HTML.c
index 660106e..bfb5248 100644
--- a/src/HTML.c
+++ b/src/HTML.c
@@ -1182,6 +1182,7 @@ static int HTML_start_element(HTStructured * me, int element_number,
break;
case HTML_LINK:
+#ifdef USE_TOOLBAR
intern_flag = FALSE;
if (present && present[HTML_LINK_HREF]) {
CHECK_FOR_INTERN(intern_flag, value[HTML_LINK_HREF]);
@@ -1476,6 +1477,7 @@ static int HTML_start_element(HTStructured * me, int element_number,
}
FREE(href);
FREE(title);
+#endif /* USE_TOOLBAR */
break;
case HTML_ISINDEX:
@@ -1679,6 +1681,7 @@ static int HTML_start_element(HTStructured * me, int element_number,
UPDATE_STYLE;
if (me->sp->tag_number == (int) ElementNumber)
LYEnsureDoubleSpace(me);
+#ifdef USE_TOOLBAR
/*
* Treat this as a toolbar if we don't have one yet, and we are in the
* first half of the first page. - FM
@@ -1693,6 +1696,7 @@ static int HTML_start_element(HTStructured * me, int element_number,
HText_endAnchor(me->text, 0);
HText_setToolbar(me->text);
}
+#endif
CHECK_ID(HTML_GEN_ID);
break;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment