emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Bastien <bzg@gnu.org>
Cc: Noah Slater <nslater@tumbolia.org>, emacs-orgmode@gnu.org
Subject: Re: Radio targets with mixed capitalisation do not work in HTML export
Date: Mon, 17 Mar 2014 15:27:44 +0100	[thread overview]
Message-ID: <87vbvcq4rj.fsf@gmail.com> (raw)
In-Reply-To: <87zjkpghff.fsf@bzg.ath.cx> (Bastien's message of "Mon, 17 Mar 2014 13:04:20 +0100")

Bastien <bzg@gnu.org> writes:

> Bastien <bzg@gnu.org> writes:
>
>> If we do this, I don't see the need to enforce case sensitivity.
>
> I attach a patch that illustrates the fix I propose on top on my
> previous commit.

I somehow missed this message.

> With this,
>
> ========================================================================
> <<<Hello \alpha world>>>
>
> Let's say hello \alpha world to test.
> ========================================================================
>
> gets converted into
>
> ========================================================================
> <p>
> <a id="Hello-alpha-world">Hello &alpha; world</a>
> </p>
>
> <p>
> Let's say <a href="#Hello-alpha-world">hello &alpha; world</a> to test.
> </p>
> ========================================================================
>
> which I think is what the OP expected.  We preserve case sensitivity
> of the target, and we preserve the link description.

Indeed, downcasing value is not necessary in this case.

> (I think the confusion comes from calling "path" what is really the
> description when path and description are the same, like in a link
> to a radio target.)

path is always a string. Description is always parsed (and transcoded
already). In the most simple cases, they are equals.

> Let me know what you think,

It could work if we revert 5174495 and b4ffae0 and propagate the changes
to "ox-latex.el", "ox-beamer.el" and "ox-ascii.el". Though, there is
still a problem to consider. See below.

> diff --git a/lisp/ox-html.el b/lisp/ox-html.el
> index 4d6180d..0cacd57 100644
> --- a/lisp/ox-html.el
> +++ b/lisp/ox-html.el
> @@ -2775,9 +2775,13 @@ INFO is a plist holding contextual information.  See
>        (let ((destination (org-export-resolve-radio-link link info)))
>  	(when destination
>  	  (format "<a href=\"#%s\"%s>%s</a>"
> -		  (org-export-data (org-element-contents destination) info)
> +		  (org-export-solidify-link-text
> +		   (org-export-data (org-element-contents destination) info))

It should be

  (org-export-solidify-link-text (org-element-property :value destination))

See `org-html-radio-target'.

> -		  (org-export-solidify-link-text path)))))
> +		  (org-export-data
> +		   (org-element-parse-secondary-string
> +		    path
> +		    (org-element-restriction 'paragraph)) info)))))

It should be:

  (org-element-restriction 'radio-target)

Anyway, this raises a question.

5174495 adds contents to radio links (and, because of this, introduces
an infloop in `org-element-context' on master, but that's another
story). Your change parses link's contents on the fly. So this is mostly
equivalent, albeit more verbose in all exporters.

So the question is : should we consider a radio-link as a link with
a description, which would basically be its parsed path? I think it is
useful because its contents can differ from its relative radio-target,
due to case-insensitivity.


Regards,

-- 
Nicolas Goaziou

  reply	other threads:[~2014-03-17 14:27 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-02 17:24 Radio targets with mixed capitalisation do not work in HTML export Noah Slater
2014-03-17  2:02 ` Bastien
2014-03-17 10:11   ` Nicolas Goaziou
2014-03-17 11:29     ` Bastien
2014-03-17 12:04       ` Bastien
2014-03-17 14:27         ` Nicolas Goaziou [this message]
2014-03-17 15:50           ` Bastien
2014-03-20 21:58             ` Bastien
2014-03-21 14:25               ` Nicolas Goaziou
2014-03-21 14:30                 ` Bastien
2014-03-21 17:25                   ` Nicolas Goaziou
2014-03-21 17:28                     ` Bastien
2014-03-21 18:47                       ` Noah Slater
2014-03-21 21:38                         ` Bastien
2014-03-23 17:13                   ` Nicolas Goaziou
2014-03-23 17:26                     ` Bastien
2014-03-24 10:24                       ` Nicolas Goaziou
2014-03-24 14:11                         ` Bastien
2014-03-25  9:24                           ` Nicolas Goaziou
2014-03-25 11:07                             ` Bastien
2014-03-24 13:23                       ` Nicolas Goaziou
2014-03-17 12:38       ` Nicolas Goaziou
2014-03-17 12:59         ` Bastien
2014-03-17 13:11           ` Nicolas Goaziou
2014-03-17 14:18             ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87vbvcq4rj.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=bzg@gnu.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=nslater@tumbolia.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).