On 19/09/2026 4:56 pm, Ihor Radchenko wrote:
A more general question is also whether we need to *parse* links and
other markup inside comments. It would make sense, especially given that
commented headings can contain markup. Although there might be pros and
cons.
I have seen multiple requests concerning how Org markup should be
handled inside comments:
# Should [[https://www.example.com][link]] be rendered as "link"
Other cases are export snippets like @@comment:...@@:
@@c: Should [[https://www.example.com][link]] be rendered as "link"@@
and even more weird variant with a newline character in description
# Should [[https://www.example.com][link
text]] be an active link
In my opinion, fontification must be limited to comment region. Perhaps
parser-based fontification will solve the issue with newlines.
# Should we *hide* emphasis markers?
# Should we make *bold* look bold inside the comment?
Just recently I saw a question about fontifying markup inside comments.
Yet, in this thread, the request is opposite - revealing the links
inside comments.
I have not seen that question, so my opinion is based solely on this thread.
I can see a value of displaying the markup inside comments, and
recognizing it on the parser level. Then, the fontification can be
customized to not fontify anything (like we do now, ish, except
links), to fontify, or fontify but not hide the emphasis markers/link
brackets.
My complain is that the "link" word in the example above is active, but
it is hidden. I believe, any approach: showing complete markup (with or
without active link) or at least underlining the link are acceptable.
Personally, I prefer to see raw markup.
I am afraid, there is no hard-coded variant that will make everybody
happy. I am not surprised if somebody prefer to have their settings like
hidden markers to be respected inside comments. All Org markup may be
fontified in comments, e.g., using less saturated colors. On the other
hand I prefer to see markers since I do not find them annoying. For me
it is better to clearly realize if edits are related to emphasized
region or not. I wouldn't mind to have even some kind of brackets around
link descriptions. (Recently I was impressed by the number of corner
cases with org-inside mode.)
Perhaps the Emacs way is to implement a minor mode that fontifies markup
inside comments (whether it is enabled should be added to bug reports).
There is a complication however. There are two kind of comments.
1. To hide parts of text from export. That may include notes on what
should be modified later or why some phrases were added. It is
convenient to have "active" markup for this purpose.
2. For debugging of unexpected effects or during comparison what Org
construct is better to achieve specific result. Almost everything should
be completely hidden from various functions related to export, code
evaluation, etc. Raw markup looks more reasonable in this case. Links
might still be active (while marked so) while <<anchors>> and
<<<radio>>> targets should be ignored.
I have no idea how to distinguish comments in prose and comments to
disable "code". Documents may contain both kinds of them.