From mboxrd@z Thu Jan 1 00:00:00 1970 From: Matt Price Subject: Re: angle brackets around timestamps in html export Date: Tue, 3 Sep 2013 10:22:55 -0400 Message-ID: References: <87d2oq3vqa.fsf@gmail.com> <87vc2i2ewj.fsf@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:54941) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGrVR-0004er-NY for emacs-orgmode@gnu.org; Tue, 03 Sep 2013 10:23:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VGrVQ-0007za-Er for emacs-orgmode@gnu.org; Tue, 03 Sep 2013 10:22:57 -0400 Received: from mail-ea0-x232.google.com ([2a00:1450:4013:c01::232]:51817) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VGrVQ-0007yn-8F for emacs-orgmode@gnu.org; Tue, 03 Sep 2013 10:22:56 -0400 Received: by mail-ea0-f178.google.com with SMTP id a15so3046661eae.37 for ; Tue, 03 Sep 2013 07:22:55 -0700 (PDT) In-Reply-To: <87vc2i2ewj.fsf@gmail.com> 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: Nicolas Goaziou Cc: Org Mode On Tue, Sep 3, 2013 at 9:50 AM, Nicolas Goaziou wrote: > Matt Price writes: > >>> You can also use a filter on every timestamp exported and make sure any >>> angle bracket is removed. >> >> I was able to add this bit of javascript to my wordpress site to >> remove the brackets: >> ----------- >> var elements = document.getElementsByClassName("timestamp"); >> for (var i = 0; i < elements.length; ++i) { >> console.log("removing timestamp"); >> elements[i].innerHTML = >> elements[i].innerHTML.replace(/(<|>|\[|\])/g,''); >> } >> --------- >> Is that what you mean by a filter, or should I be doing something in >> emacs. > > I basically meant the Elisp counterpart of this. See > `org-export-filter-timestamp-functions' and "12.13 Advanced > configuration" in Org manual. 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. Again, many thanks. matt > > > Regards, > > -- > Nicolas Goaziou