[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] angle brackets around timestamps in html export
From: |
Matt Price |
Subject: |
Re: [O] angle brackets around timestamps in html export |
Date: |
Tue, 3 Sep 2013 10:22:55 -0400 |
On Tue, Sep 3, 2013 at 9:50 AM, Nicolas Goaziou <address@hidden> wrote:
> Matt Price <address@hidden> 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