[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: modernizing html output
From: |
Mathieu Lirzin |
Subject: |
Re: modernizing html output |
Date: |
Wed, 03 Apr 2019 00:43:28 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) |
Hello,
Per Bothner <address@hidden> writes:
> On 1/28/19 12:05 PM, Gavin Smith wrote:
>> On Tue, Jan 01, 2019 at 05:46:11PM -0800, Per Bothner wrote:
>>
>> diff --git a/js/info.js b/js/info.js
>> index 10a2b1d..0175d35 100644
>> --- a/js/info.js
>> +++ b/js/info.js
>> @@ -1170,7 +1170,7 @@
>> if (linkid === config.INDEX_ID)
>> {
>> hide_grand_child_nodes (ul);
>> - res = elem.querySelector ("a[name=\"" + linkid + "\"]");
>> + res = elem.querySelector ("a[id=\"" + linkid + "\"]");
>
> I suggest trying just a simple "id selector":
>
> res = elem.querySelector("#" + linkid);
>
> This should work on any element with a match 'id' attribute.
> I'd like us to get away from using <a> element for link definitions.
> For example (if we can get makenifo to DTRT):
>
> <div class="node" id="NODE-ID">...</div>
‘id’ attributes are supposed to be unique [1], as a consequence it seems
that there is no need to “querySelect” from a parent element anymore.
We could simply use the following:
document.getElementById (linkid)
I am glad to see some interest in using and improving ‘texinfo-js’.
Sorry for the late reply.
[1] https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/id
--
Mathieu Lirzin
GPG: F2A3 8D7E EB2B 6640 5761 070D 0ADE E100 9460 4D37
- Re: modernizing html output,
Mathieu Lirzin <=