[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [O] angle brackets around timestamps in html export
From: |
Nicolas Goaziou |
Subject: |
Re: [O] angle brackets around timestamps in html export |
Date: |
Tue, 03 Sep 2013 16:34:06 +0200 |
Matt Price <address@hidden> 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