[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: org-->html text between @ should be red.
From: |
Uwe Brauer |
Subject: |
Re: org-->html text between @ should be red. |
Date: |
Sat, 15 Jan 2022 20:39:02 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/29.0.50 (gnu/linux) |
>>> "JMM" == Juan Manuel Macías <maciaschain@posteo.net> writes:
> Uwe Brauer writes:
>> Can I have a similar setting when exporting an org file to html via the
>> «normal» html exporter?
> Using a custom filter?
> #+begin_src emacs-lisp
> (defun foo (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-final-output-functions 'foo)
> #+end_src
Thanks very much it works as expected. However I just realized (and this is
true also for the org-mime filter that the reg-exp has a flaw.
I used the text
=email:oub@mat.ucm.es=
So there is only one @, nevertheless the exporter translated that to
<code>email:oub<span style="color:red">mat.ucm.es</code><br />
But this is wrong in my view.
Any ideas how to deal with such a situation?
Thanks
Uwe
smime.p7s
Description: S/MIME cryptographic signature
Re: org-->html text between @ should be red., Timothy, 2022/01/15