emacs-orgmode
[Top][All Lists]
Advanced

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

[BUG] manual: confusing example of adding attributes to a link (affiliat


From: Max Nikulin
Subject: [BUG] manual: confusing example of adding attributes to a link (affiliated keywords)
Date: Mon, 20 Jun 2022 23:25:29 +0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1

Hi,

Org Manual in info "(org) Links in HTML export" https://orgmode.org/manual/Links-in-HTML-export.html has the following example:

Org files can also have special directives to the HTML export
back-end. For example, by using ‘#+ATTR_HTML’ lines to specify new
format attributes to <a> or <img> tags. This example shows changing
the link’s title and style:

#+ATTR_HTML: :title The Org mode homepage :style color:red;
[[https://orgmode.org]]

Likely I have seen similar suggestions in this list as well.

Actually it assigns attribute to paragraphs in addition to links. That is why, I think, this fragment should be removed from manual as a confusing one since it gives impression of support of per-link attributes.

Attributes assigned through affiliated keywords belongs to paragraph (block-level element), not to link (inline object). Actual result of export:

    <p title="The Org mode homepage" style="color:red;">
<a href="https://orgmode.org"; title="The Org mode homepage" style="color:red;">https://orgmode.org</a>
    </p>

If it were possible to set attributes to links, the result should be

    <p>
<a href="https://orgmode.org"; title="The Org mode homepage" style="color:red;">https://orgmode.org</a>
    </p>

The reason of my expectation is that a paragraph may have more than one link with different titles.

I am unsure if formal bug report will help. I promised it in the following discussion: Max Nikulin to emacs-orgmode. Re: Org-syntax: Intra-word markup. Thu, 3 Feb 2022 19:10:19 +0700. https://list.orgmode.org/stggnf$d8g$1@ciao.gmane.io

A similar complain:
Anton Linevych. How to add extra attributes to link in Org-mode? 2017-06-21 https://linevi.ch/en/org-link-extra-attrs.html

The reason why I have decided to post this bug report now is the following message: Juan Manuel Macías to emacs-orgmode. Re: About 'inline special blocks' Sun, 19 Jun 2022 12:47:40 +0000. 875ykwvmz7.fsf@posteo.net">https://list.orgmode.org/875ykwvmz7.fsf@posteo.net

It states that styles and similar stuff may solve the issue with attributes for inline objects. From my point of view it is wrong and in some cases per-object attributes are necessary. While <a rel="nofollow noreferrer" href="..."> or <a target="_blank" href="..."> may be added through style, attributes like "alt" for images, "title", "lang", etc. for links are individual.

I am aware of the following post:
J. Kitchin. Extending the org-mode link syntax with attributes. 2015-02-05 http://kitchingroup.cheme.cmu.edu/blog/2015/02/05/Extending-the-org-mode-link-syntax-with-attributes/ The recipe solves the problem, but this time the topic of inline special blocks has been risen in the context of limitations in Org markup making it inappropriate tool for GNU manuals in general and the Org manual in particular. So some more general solution is required than local customization.

So as outcome for this bug report I expect that either caveats related to affiliated keywords are clearly stated in the manual or some "official" way to assign attributes for specific inline objects is introduced.




reply via email to

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