From 533eac7d8cb25e31ed0cb896660a05e70c4ee535 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Wed, 27 Jul 2005 07:40:03 +0000 Subject: [PATCH] Escape email address and URL always. * lisp/muse-publish.el (muse-publish-markup-email): Move lower. Always escape and publish email address as read-only, even when it's not marked up. (muse-publish-markup-url): Ditto for URL. git-archimport-id: mwolson@gnu.org--2005/muse--main--1.0--patch-188 --- ChangeLog | 16 ++++++++++++++++ Makefile.defs | 2 +- debian/changelog | 6 ++++++ lisp/muse-publish.el | 32 +++++++++++++++++++------------- 4 files changed, 42 insertions(+), 14 deletions(-) diff --git a/ChangeLog b/ChangeLog index 2f671d1..96c8ac7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,22 @@ # arch-tag: automatic-ChangeLog--mwolson@gnu.org--2005/muse--main--1.0 # +2005-07-27 07:40:03 GMT Michael Olson patch-188 + + Summary: + Escape email address and URL always. + Revision: + muse--main--1.0--patch-188 + + * lisp/muse-publish.el (muse-publish-markup-email): Move lower. Always + escape and publish email address as read-only, even when it's not + marked up. + (muse-publish-markup-url): Ditto for URL. + + modified files: + ChangeLog Makefile.defs debian/changelog lisp/muse-publish.el + + 2005-07-26 08:49:38 GMT Michael Olson patch-187 Summary: diff --git a/Makefile.defs b/Makefile.defs index c4ecc08..c8eda0f 100644 --- a/Makefile.defs +++ b/Makefile.defs @@ -20,4 +20,4 @@ INSTALLINFO = install-info --info-dir=$(INFODIR) #INSTALLINFO = install-info --section "Emacs" "emacs" --info-dir=$(INFODIR) # Useful only for the maintainer -VERSION = 3.01.arch.160 +VERSION = 3.01.arch.188 diff --git a/debian/changelog b/debian/changelog index 4dda4ca..13e46db 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +muse-el (3.01.arch.188-1) unstable; urgency=low + + * New Arch snapshot. + + -- Michael W. Olson (GNU address) Wed, 27 Jul 2005 02:23:56 -0500 + muse-el (3.01.arch.160-1) unstable; urgency=low * New Arch snapshot. diff --git a/lisp/muse-publish.el b/lisp/muse-publish.el index 816b2fa..cee6c8b 100644 --- a/lisp/muse-publish.el +++ b/lisp/muse-publish.el @@ -956,17 +956,6 @@ like read-only from being inadvertently deleted." (defun muse-publish-markup-table () "Style does not support tables.") -(defun muse-publish-markup-email () - (let* ((beg (match-end 1)) - (addr (buffer-substring-no-properties beg (match-end 0)))) - (when (not (or (eq (char-before (match-beginning 0)) ?\") - (eq (char-after (match-end 0)) ?\"))) - (muse-publish-escape-specials-in-string addr) - (goto-char beg) - (delete-region beg (match-end 0)) - (insert (format (muse-markup-text 'email-addr) addr addr)) - (muse-publish-mark-read-only beg (point))))) - (defun muse-publish-escape-specials-in-string (string &rest ignored) "Escape specials in STRING using style-specific :specials." (save-excursion @@ -981,6 +970,18 @@ like read-only from being inadvertently deleted." (cdr repl)))) (append string nil))))) +(defun muse-publish-markup-email () + (let* ((beg (match-end 1)) + (addr (buffer-substring-no-properties beg (match-end 0)))) + (setq addr (muse-publish-escape-specials-in-string addr)) + (goto-char beg) + (delete-region beg (match-end 0)) + (if (or (eq (char-before (match-beginning 0)) ?\") + (eq (char-after (match-end 0)) ?\")) + (insert addr) + (insert (format (muse-markup-text 'email-addr) addr addr))) + (muse-publish-mark-read-only beg (point)))) + (defun muse-publish-url (url &optional desc explicit) "Resolve a URL into its final form." (let ((orig-url url)) @@ -1027,9 +1028,14 @@ like read-only from being inadvertently deleted." (muse-publish-insert-url link desc explicit)))) (defun muse-publish-markup-url () - (when (not (or (eq (char-before (match-beginning 0)) ?\") + (if (not (or (eq (char-before (match-beginning 0)) ?\") (eq (char-after (match-end 0)) ?\"))) - (muse-publish-insert-url (match-string 0)))) + (muse-publish-insert-url (match-string 0)) + (let ((beg (match-beginning 0)) + (url (match-string 0))) + (delete-region (match-beginning 0) (match-end 0)) + (insert (muse-publish-escape-specials-in-string url)) + (muse-publish-mark-read-only beg (point))))) ;; Default publishing tags -- 2.11.4.GIT