[Top][All Lists]

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

Re: Converting a string to valid XHTML id?

From: Lennart Borgman
Subject: Re: Converting a string to valid XHTML id?
Date: Thu, 2 Dec 2010 03:54:48 +0100

On Thu, Dec 2, 2010 at 3:37 AM, Kevin Rodgers <address@hidden> wrote:
> On 12/1/10 12:51 PM, Lennart Borgman wrote:
>> On Wed, Dec 1, 2010 at 4:51 PM, Stefan Monnier<address@hidden>
>>  wrote:
>>>>> collapsing two different strings to the same ID, resulting in
>>>>> invalid html.
>>> I have no idea what those ids are for, but wouldn't a cryptographic hash
>>> work as well?
>> It is just the value of the id attribute, for example like this:
>>    <span id="...">
> Is the point of your function to create a syntactically valid XHTML id from
> a
> string that is assumed to be unique within the context of the current
> document,
> or is it to generate a syntactically valid, unique XHTML id every time it is
> called (even when called multiple times with the same string)?

Currently unique within the current document.

In the context where it is used it is for export of org-mode files to
xhtml. Obviously if there are links to anchors within other files my
approach will fails.

So, hm, maybe I should reset this variable when starting a directory
tree export or a single file export rather than making it buffer
local. (But then I have to look into the export of directory trees in
org-mode which I have not done yet.)

reply via email to

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