emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Uwe Brauer <oub@mat.ucm.es>
To: emacs-orgmode@gnu.org
Subject: export to html, colored dates: org-mime export works but org to html does not
Date: Sat, 11 Feb 2023 09:27:49 +0100	[thread overview]
Message-ID: <87a61kwqre.fsf@mat.ucm.es> (raw)


Hi

The following drives me a bit crazy.

I have two functions, one for email.


(defun my-color-red-html ()
  (interactive)
  (while (re-search-forward "#\\([^#]*\\)#" nil t)
    (replace-match "<span style=\"color:red\">\\1</span>")))

I put this function into  two hooks

  (add-hook 'org-mime-html-hook 'my-color-red-html)


(defun my-html-red (text backend info)
    (when (org-export-derived-backend-p backend 'html)
      (replace-regexp-in-string "#\\([^#]*\\)#"
				"<span style=\"color:red\">\\1</span>"
				text)))

  (add-to-list 'org-export-filter-plain-text-functions 'my-html-red)

Now if I have 
#<2023-02-11>#
in an email it gets replaced by 

<span style="color:red"><span class="timestamp-wrapper"><span class="timestamp"> 11.02.2023 </span></span></span>


But if I have 
#<2023-02-11>#
in an org file and export it to html, no color is added to the timestamp.

I don't know how to debug this.

Any idea?

Regards

Uwe Brauer 

-- 
Warning: Content may be disturbing to some audiences
I strongly condemn Putin's war of aggression against the Ukraine.
I support to deliver weapons to Ukraine's military. 
I support the ban of Russia from SWIFT.
I support the EU membership of the Ukraine. 
https://addons.thunderbird.net/en-US/thunderbird/addon/gmail-conversation-view/



             reply	other threads:[~2023-02-11  8:29 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-11  8:27 Uwe Brauer [this message]
2023-02-11  8:54 ` export to html, colored dates: org-mime export works but org to html does not Bruno Barbier
2023-02-11  9:07   ` Uwe Brauer
2023-02-11  9:58     ` Ihor Radchenko
2023-02-11 10:16       ` Uwe Brauer
2023-02-11 10:34         ` Ihor Radchenko
2023-02-11 11:08           ` Uwe Brauer
2023-02-11 11:41             ` Ihor Radchenko
     [not found]               ` <8846480D-F028-4660-B3E8-26FF99F54F23@mat.ucm.es>
2023-02-11 14:13                 ` Ihor Radchenko
2023-02-11 14:20                   ` Uwe Brauer
2023-02-11 10:05     ` Bruno Barbier

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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=87a61kwqre.fsf@mat.ucm.es \
    --to=oub@mat.ucm.es \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).