emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* export to html, colored dates: org-mime export works but org to html does not
@ 2023-02-11  8:27 Uwe Brauer
  2023-02-11  8:54 ` Bruno Barbier
  0 siblings, 1 reply; 11+ messages in thread
From: Uwe Brauer @ 2023-02-11  8:27 UTC (permalink / raw)
  To: emacs-orgmode


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/



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-02-11 14:21 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-11  8:27 export to html, colored dates: org-mime export works but org to html does not Uwe Brauer
2023-02-11  8:54 ` 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

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