emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jon Miller <jonebird@gmail.com>
To: emacs-orgmode@gnu.org
Subject: [PATCH] org-mime.el: correct element matching regex
Date: Fri, 12 Dec 2014 12:27:49 -0800	[thread overview]
Message-ID: <vl8flhmck3zu.fsf@crad-millertime.qualcomm.com> (raw)
In-Reply-To: mailman.117.1418403631.31732.emacs-orgmode@gnu.org

* org-mime.el (org-mime-change-element-style): Correctly capture the
  html element instead of partially.

Passing element of "p" would end up matching and altering "pre"
elements as well. Need to properly anchor the regex to html elements.

 contrib/lisp/org-mime.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/contrib/lisp/org-mime.el b/contrib/lisp/org-mime.el
index 44bf91b..f341474 100644
--- a/contrib/lisp/org-mime.el
+++ b/contrib/lisp/org-mime.el
@@ -111,7 +111,7 @@
 ;; example hook, for setting a dark background in <pre style="background-color: #EEE;"> elements
 (defun org-mime-change-element-style (element style)
   "Set new default htlm style for <ELEMENT> elements in exported html."
-  (while (re-search-forward (format "<%s" element) nil t)
+  (while (re-search-forward (format "<%s\\>" element) nil t)
     (replace-match (format "<%s style=\"%s\"" element style))))
 (defun org-mime-change-class-style (class style)

Jon Miller

       reply	other threads:[~2014-12-12 20:28 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.117.1418403631.31732.emacs-orgmode@gnu.org>
2014-12-12 20:27 ` Jon Miller [this message]
2014-12-14  8:34   ` [PATCH] org-mime.el: correct element matching regex Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vl8flhmck3zu.fsf@crad-millertime.qualcomm.com \
    --to=jonebird@gmail.com \
    --cc=emacs-orgmode@gnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).