lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Lynx-dev] recommendation for creating bookmarks


From: russellbell
Subject: [Lynx-dev] recommendation for creating bookmarks
Date: Mon, 6 Dec 2021 08:15:48 -0700

        When lynx creates a bookmark it doesn't terminate the line
with a </li>; it also uses uppercase.  I recommend:

diff -aprNU5 LYBookmark.c LYBookmark_mine.c

--- LYBookmark.c        2019-01-02 14:14:08.000000000 -0700
+++ LYBookmark_mine.c   2021-12-06 08:01:16.090545647 -0700
@@ -174,14 +174,14 @@ static const char *convert_mosaic_bookma
        if (line >= 0) {
            LYTrimNewline(buf);
            if ((line % 2) == 0) {      /* even lines */
                if (*buf != '\0') {
                    strtok(buf, " ");   /* kill everything after the space */
-                   fprintf(nfp, "<LI><a href=\"%s\">", buf);   /* the URL */
+                   fprintf(nfp, "<li><a href=\"%s\">", buf);   /* the URL */
                }
            } else {            /* odd lines */
-               fprintf(nfp, "%s</a>\n", buf);  /* the title */
+               fprintf(nfp, "%s</a></li>\n", buf);     /* the title */
            }
        }
        /* else - ignore the line (this gets rid of first two lines) */
        line++;
     }
@@ -405,11 +405,11 @@ Note: if you edit this file manually\n\
        /*
         * TimeString has a \n at the end.
         */
        fprintf(fp, "%s %s%s\n", Address, TimeString, Title);
     } else {
-       fprintf(fp, "<LI><a href=\"%s\">%s</a>\n", Address, Title);
+       fprintf(fp, "<li><a href=\"%s\">%s</a></li>\n", Address, Title);
     }
     LYCloseOutput(fp);
 
     SetDefaultMode(O_BINARY);
     /*
@@ -534,17 +534,17 @@ void remove_bookmark_link(int cur,
            int keep_ol = FALSE;
 
            retain = TRUE;
            seen = 0;
            cp = buf;
-           if ((cur == 0) && LYstrstr(cp, "<ol><LI>"))
+           if ((cur == 0) && LYstrstr(cp, "<ol><li>"))
                keep_ol = TRUE; /* Do not erase, this corrects a bug in an
                                   older version */
            while (n < cur && (cp = LYstrstr(cp, "<a href="))) {
                seen++;
                if (++n == cur) {
-                   if (seen != 1 || !LYstrstr(buf, "</a>") ||
+                   if (seen != 1 || !LYstrstr(buf, "</a></li>") ||
                        LYstrstr((cp + 1), "<a href=")) {
                        HTAlert(BOOKMARK_LINK_NOT_ONE_LINE);
                        goto failure;
                    }
                    CTRACE((tfp, "remove_bookmark_link: skipping link %d\n", 
n));



reply via email to

[Prev in Thread] Current Thread [Next in Thread]