From a24fbd81bc066abcb32c0c143a6c0ceea2b4525b Mon Sep 17 00:00:00 2001 From: "Michael W. Olson" Date: Thu, 6 Sep 2007 10:15:29 -0400 Subject: [PATCH] Fix failure to detect nested class tags * lisp/muse-html.el (muse-html-class-tag): Fix bug where nested class tags were not working. We move to just after the beginning of the first class tag, so that we can detect any remaining class tags. Thanks to Florian Beck for the report. * lisp/muse.el (muse-goto-tag-end): Fix bug where nested tags with arguments were not being detected properly. --- ChangeLog | 10 ++++++++++ lisp/muse-html.el | 5 +++-- lisp/muse.el | 5 +++-- 3 files changed, 16 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 04c955f..b2d62b6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,13 @@ +2007-09-06 Michael Olson + + * lisp/muse-html.el (muse-html-class-tag): Fix bug where nested + class tags were not working. We move to just after the beginning + of the first class tag, so that we can detect any remaining class + tags. Thanks to Florian Beck for the report. + + * lisp/muse.el (muse-goto-tag-end): Fix bug where nested tags with + arguments were not being detected properly. + 2007-09-05 Michael Olson * lisp/muse-context.el (muse-context-decide-specials): Add diff --git a/lisp/muse-html.el b/lisp/muse-html.el index 25f68c0..c33990f 100644 --- a/lisp/muse-html.el +++ b/lisp/muse-html.el @@ -593,8 +593,9 @@ table of contents." (defun muse-html-class-tag (beg end attrs) (goto-char beg) (muse-insert-markup "") - (goto-char end) - (muse-insert-markup "")) + (save-excursion + (goto-char end) + (muse-insert-markup ""))) (defun muse-html-src-tag (beg end attrs) "Publish the region using htmlize. diff --git a/lisp/muse.el b/lisp/muse.el index 2ff0dfe..251fa38 100644 --- a/lisp/muse.el +++ b/lisp/muse.el @@ -858,14 +858,15 @@ may be nested inside of this tag, and skip past them." (if (not nested) (search-forward (concat "") nil t) (let ((nesting 1) - (tag-regexp (concat "\\(<\\(/?\\)" tag ">\\)")) + (tag-regexp (concat "\\(<\\(/?\\)" tag "\\([ >]\\)\\)")) (match-found nil)) (while (and (> nesting 0) (setq match-found (re-search-forward tag-regexp nil t))) ;; for the sake of font-locking code, skip matches in comments (unless (get-text-property (match-beginning 0) 'muse-comment) (if (string-equal (match-string 2) "/") - (setq nesting (1- nesting)) + (and (string-equal (match-string 3) ">") + (setq nesting (1- nesting))) (setq nesting (1+ nesting))))) match-found))) -- 2.11.4.GIT