emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Links & images with different attributes in the same paragraph


From: Max Nikulin
Subject: Re: Links & images with different attributes in the same paragraph
Date: Tue, 19 Dec 2023 21:39:26 +0700
User-agent: Mozilla Thunderbird

On 16/12/2023 21:44, Ihor Radchenko wrote:
Max Nikulin writes:

@wrap{{outer wrap; @wrap{{inner wrap allowing } as well}}; back}}.

Are you assuming invisible zero-width space as a way to escape literal
{{ or }}? I would prefer some visible characters.

No, not zero-width space. Literally, {{...}}. The idea is to define
delimiters as "[{]+" the matching number of "}". This way, we do not
need to worry about escaping "}" inside and can get nested markup for
free. It is more or less how Org parser works for special block:
the opening delimiter is #+begin_whatever is matched against
#+end_<same as opening delimiter>.

I am afraid, there is an issue if wrapped content is surrounded by braces. An ambiguity arises for

    @wrap{{{content}}}

it may be @wrap{{{ content }}}, @wrap{{ {content} }},
or @wrap{ {{content}} }. It seems, some escape character is unavoidable.

Also, see https://list.orgmode.org/orgmode/87mtaez8do.fsf@localhost/
with my original proposal and some discussion that followed up.

I completely forgot that you wrote about balanced parenthesis earlier.

Juan Manuel MacĂ­as. Re: About 'inline special blocks'
Bringing that into the paragraph is
unnecessarily overloading the paragraph and breaking the social contract
of lightweight markup, where paragraphs should still look like
paragraphs.

I am pretty sure that I replied to that concern raised in a parallel
thread. My idea was to allow macro replacement inside attributes:

#+macro: alt #+attr_html :alt $1
What about @wrap[<<<alt(Text)>>>]{[[/path/to/image]]}

Certainly it allows to shorten in-text arguments. Just as noweb references, it has some disadvantages. I consider comma as macro argument separator as a kind of a pitfall. Macro definitions, unlike code blocks definitions for noweb references, can not be multiline
(unless defined in elisp code).

Unless something better will be proposed, I consider macro expansion inside arguments as a viable approach. (I can not recall if it was discussed earlier.)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]