From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: angle brackets around timestamps in html export Date: Tue, 03 Sep 2013 16:34:06 +0200 Message-ID: <87eh962cv5.fsf@gmail.com> References: <87d2oq3vqa.fsf@gmail.com> <87vc2i2ewj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:57745) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGrgA-0001wM-0w for emacs-orgmode@gnu.org; Tue, 03 Sep 2013 10:34:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGrg1-000348-KM for emacs-orgmode@gnu.org; Tue, 03 Sep 2013 10:34:01 -0400 Received: from mail-ee0-x234.google.com ([2a00:1450:4013:c00::234]:35653) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGrg1-000341-EY for emacs-orgmode@gnu.org; Tue, 03 Sep 2013 10:33:53 -0400 Received: by mail-ee0-f52.google.com with SMTP id c41so3008946eek.25 for ; Tue, 03 Sep 2013 07:33:52 -0700 (PDT) In-Reply-To: (Matt Price's message of "Tue, 3 Sep 2013 10:22:55 -0400") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Matt Price Cc: Org Mode Matt Price writes: > thanks nicolas. If you happen to have a moment, I'm having trouble > reproducing this regexp in elisp. I would think that, even if I can't > figure out how to construct a single regex that matches all the > characters I want to remove, omething like this ought to work: > ------- > (defun matt-org-export-filter-timestamp-function (timestamp backend info) > "removes relevant brackets from a timestamp" > (when (org-export-derived-backend-p backend 'html) > ;; unfortunatley I can't make emacs regexps work yet. sigh. > (replace-regexp-in-string "[][]" "" timestamp) > ;; (replace-regexp-in-string "<" "" timestamp) > )) > -------------- > but the second (commented-out) regexp seems to break my export. The following should work: (defun matt-org-export-filter-timestamp-function (timestamp backend info) "removes relevant brackets from a timestamp" (when (org-export-derived-backend-p backend 'html) (replace-regexp-in-string "&[lg]t;\\|[][]" "" timestamp))) (add-to-list 'org-export-filter-timestamp-functions 'matt-org-export-filter-timestamp-function) Regards, -- Nicolas Goaziou