emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* link export confused when URL parameter is another URL
@ 2010-09-30 20:17 Cook, Malcolm
  2010-10-21  4:35 ` David Maus
  0 siblings, 1 reply; 5+ messages in thread
From: Cook, Malcolm @ 2010-09-30 20:17 UTC (permalink / raw)
  To: 'emacs-orgmode@gnu.org'


If find that this orgtext

	[[http://www.foo.com/foo?URL=http://www.bar.com][test]]

exports to html incorrectly as

	[[http://www.foo.com/foo?URL=[[http://www.bar.com][test][http://www.bar.com][test]]]

using today's fresh git pull make install

Any pointers?

Thanks

Malcolm Cook
Stowers Institute for Medical Research -  Bioinformatics
Kansas City, Missouri  USA
 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: link export confused when URL parameter is another URL
  2010-09-30 20:17 link export confused when URL parameter is another URL Cook, Malcolm
@ 2010-10-21  4:35 ` David Maus
  2010-10-21 13:37   ` Cook, Malcolm
  2010-10-21 17:38   ` Carsten Dominik
  0 siblings, 2 replies; 5+ messages in thread
From: David Maus @ 2010-10-21  4:35 UTC (permalink / raw)
  To: Cook, Malcolm; +Cc: 'emacs-orgmode@gnu.org'


[-- Attachment #1.1: Type: text/plain, Size: 942 bytes --]

At Thu, 30 Sep 2010 15:17:00 -0500,
Cook, Malcolm wrote:
>
>
> If find that this orgtext
>
> 	[[http://www.foo.com/foo?URL=http://www.bar.com][test]]
>
> exports to html incorrectly as
>
> 	[[http://www.foo.com/foo?URL=[[http://www.bar.com][test][http://www.bar.com][test]]]
>
> using today's fresh git pull make install
>
> Any pointers?

The problem here is that Org's (legacy) support for plain links
(i.e. without square brackets) kicks in and transforms the fragment
part to a normal square bracket link.

My regexp-foo is not as it should be, but I am on this one to fix it;
What we need to express in `org-export-normalize-link' is, that a
plain link is something that looks like a hyperlink but not preceded
directly by a square or angle bracket and not after a question mark
followed by zero or more no-whitespace-characters.

Best,
  -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: link export confused when URL parameter is another URL
  2010-10-21  4:35 ` David Maus
@ 2010-10-21 13:37   ` Cook, Malcolm
  2010-10-21 17:38   ` Carsten Dominik
  1 sibling, 0 replies; 5+ messages in thread
From: Cook, Malcolm @ 2010-10-21 13:37 UTC (permalink / raw)
  To: 'David Maus'; +Cc: 'emacs-orgmode@gnu.org'

David,

Thanks for your sleuthing.....

I've not been digging on orgmode internals, so I defer to you of course.  

But it seems to me that the [[link][text]] pattern might provide a context in which embedded links are not sought (i.e. there is no link internal to top-level link).

Just a thought.... perhaps expressible as a context-free-grammar.

Cheers back,

Malcolm
 

-----Original Message-----
From: David Maus [mailto:dmaus@ictsoc.de] 
Sent: Wednesday, October 20, 2010 11:36 PM
To: Cook, Malcolm
Cc: 'emacs-orgmode@gnu.org'
Subject: Re: [Orgmode] link export confused when URL parameter is another URL

At Thu, 30 Sep 2010 15:17:00 -0500,
Cook, Malcolm wrote:
>
>
> If find that this orgtext
>
> 	[[http://www.foo.com/foo?URL=http://www.bar.com][test]]
>
> exports to html incorrectly as
>
> 	
> [[http://www.foo.com/foo?URL=[[http://www.bar.com][test][http://www.ba
> r.com][test]]]
>
> using today's fresh git pull make install
>
> Any pointers?

The problem here is that Org's (legacy) support for plain links (i.e. without square brackets) kicks in and transforms the fragment part to a normal square bracket link.

My regexp-foo is not as it should be, but I am on this one to fix it; What we need to express in `org-export-normalize-link' is, that a plain link is something that looks like a hyperlink but not preceded directly by a square or angle bracket and not after a question mark followed by zero or more no-whitespace-characters.

Best,
  -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: link export confused when URL parameter is another URL
  2010-10-21  4:35 ` David Maus
  2010-10-21 13:37   ` Cook, Malcolm
@ 2010-10-21 17:38   ` Carsten Dominik
  2010-10-22  4:28     ` David Maus
  1 sibling, 1 reply; 5+ messages in thread
From: Carsten Dominik @ 2010-10-21 17:38 UTC (permalink / raw)
  To: David Maus; +Cc: Cook, Malcolm, 'emacs-orgmode@gnu.org'


On Oct 21, 2010, at 6:35 AM, David Maus wrote:

> At Thu, 30 Sep 2010 15:17:00 -0500,
> Cook, Malcolm wrote:
>>
>>
>> If find that this orgtext
>>
>> 	[[http://www.foo.com/foo?URL=http://www.bar.com][test]]
>>
>> exports to html incorrectly as
>>
>> 	[[http://www.foo.com/foo?URL=[[http://www.bar.com][test][http://www.bar.com 
>> ][test]]]
>>
>> using today's fresh git pull make install
>>
>> Any pointers?
>
> The problem here is that Org's (legacy) support for plain links
> (i.e. without square brackets) kicks in and transforms the fragment
> part to a normal square bracket link.
>
> My regexp-foo is not as it should be, but I am on this one to fix it;
> What we need to express in `org-export-normalize-link' is, that a
> plain link is something that looks like a hyperlink but not preceded
> directly by a square or angle bracket and not after a question mark
> followed by zero or more no-whitespace-characters.

This is a bit hard without lookbehind assertions as they are available
in perl.  For something like this it is somtimes easier to just to
the normal match you wanted to use anyway and then confirm by
taking a separate look at the text before the match
which is, for example,

   (buffer-substring (point-at-bol) (match-beginning 0))

HTH

- Carsten

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: link export confused when URL parameter is another URL
  2010-10-21 17:38   ` Carsten Dominik
@ 2010-10-22  4:28     ` David Maus
  0 siblings, 0 replies; 5+ messages in thread
From: David Maus @ 2010-10-22  4:28 UTC (permalink / raw)
  To: Carsten Dominik
  Cc: David Maus, Cook, Malcolm, 'emacs-orgmode@gnu.org'


[-- Attachment #1.1: Type: text/plain, Size: 743 bytes --]

At Thu, 21 Oct 2010 19:38:17 +0200,
Carsten Dominik wrote:
> This is a bit hard without lookbehind assertions as they are available
> in perl.  For something like this it is somtimes easier to just to
> the normal match you wanted to use anyway and then confirm by
> taking a separate look at the text before the match
> which is, for example,
>
>    (buffer-substring (point-at-bol) (match-beginning 0))

Thanks, that looks much better than using looking-back.  I've pushed a
possible fix to master.  Plain links that are behind the query part of
something that looks like a bracket link ("\\[\\[\\S-+:\\S-*?") are
now not normalized.

Best,
  -- David
--
OpenPGP... 0x99ADB83B5A4478E6
Jabber.... dmjena@jabber.org
Email..... dmaus@ictsoc.de

[-- Attachment #1.2: Type: application/pgp-signature, Size: 230 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2010-10-22  4:28 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-09-30 20:17 link export confused when URL parameter is another URL Cook, Malcolm
2010-10-21  4:35 ` David Maus
2010-10-21 13:37   ` Cook, Malcolm
2010-10-21 17:38   ` Carsten Dominik
2010-10-22  4:28     ` David Maus

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).