[Top][All Lists]

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

[Erbot-cvs] Changes to erbot/erbutils.el

From: Pete Kazmier
Subject: [Erbot-cvs] Changes to erbot/erbutils.el
Date: Sat, 08 Jan 2005 20:55:43 -0500

Index: erbot/erbutils.el
diff -u erbot/erbutils.el:1.23 erbot/erbutils.el:1.24
--- erbot/erbutils.el:1.23      Sat Jan  8 17:53:08 2005
+++ erbot/erbutils.el   Sun Jan  9 01:10:42 2005
@@ -670,7 +670,17 @@
                    (erbutils-listp-proper (cdr l)))))
+(defun erbutils-html-url-p (str)
+  "Guesses if the string is a url that will yield HTML content.
+Basically, look for any url that doesn't have any extension or
+one that has .html, .shtml, or .htm.  Returns the str if it is
+a valid url that might generate HTML."
+  (when (string-match "^http://[^/]+/?\\(.*\\)?$" str)
+    (let* ((path (match-string 1 str))
+           (pos (position ?. path :from-end)))
+      (when (or (null pos)
+                (string-match "html?" (subseq path pos)))
+        str))))

reply via email to

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