emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [BUG] org-html.el: internal links don't work unless CUSTOM_ID is used
@ 2011-01-30 14:48 Vladimir Alexiev
  0 siblings, 0 replies; only message in thread
From: Vladimir Alexiev @ 2011-01-30 14:48 UTC (permalink / raw)
  To: emacs-orgmode

Internal links do not work in HTML export unless CUSTOM_ID is used.

I have tried with [[id:]] and [[*Heading]] links.
It makes the link like this:
  <a href="#sec-49">
It makes the anchor like this:
  <h2 id="sec-49">...</h2>
and if the entry has ID (id: link is used) then also
  <a name="ID-80ea259f-73f0-4456-b2f5-3343d44e6336"
  id="ID-80ea259f-73f0-4456-b2f5-3343d44e6336"></a>
Unfortunately h2.id doesn't create an anchor, 
and even for id: links it uses <href="#sec-49">, which doesn't work.

I wondered how links in WORK work, so I checked, e.g.
  http://orgmode.org/worg/org-contrib/babel/intro.html
The link is denoted like this
  [[#source-code-execution][here]]
and the target like this:
  * Source Code Execution
    :PROPERTIES:
    :CUSTOM_ID: source-code-execution
    :END:

Indeed the Org manual advises:
  The most important case is a link like
  `[[#my-custom-id]]' which will link to the entry with the `CUSTOM_ID'
  property `my-custom-id'.  Such custom IDs are very good for HTML export
  (*note HTML export::) where they produce pretty section links.
But it would be very tedious to add CUSTOM_ID to every target,
and the manual also hints to it:
  You are responsible yourself to make sure these custom IDs are unique

Having to go out and make a target interrupts one's flow.
It's much faster to type "[[*He" and use completion to create the link.

That's why I've marked this "BUG" and not "Enhancement".

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-30 14:48 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-30 14:48 [BUG] org-html.el: internal links don't work unless CUSTOM_ID is used Vladimir Alexiev

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