It seems that the configuration for TOC links is quite hard-wired, so it will be easiest to post-process the HTML using make4ht build file. The following code uses the luaxml-domobject
library to process the HTML using DOM functions:
local domfilter = require "make4ht-domfilter"
local process = domfilter {function(dom)
-- find the table of contents
local toc = dom:query_selector("div.tableofcontents")[1]
if toc then
-- process all TOC lines
for _, span in ipairs(toc:query_selector("span")) do
-- get a full title
local text = span:get_text()
for i, curr in ipairs(span._children) do
-- remove the section numbers
if curr:is_text() then
curr:remove_node()
-- set a full title to the link
elseif curr:is_element() then
curr._children = {}
curr:add_child_node(curr:create_text_node(text))
end
end
end
end
return dom
end}
Make:match("html$", process)
This is the result:
<h3 class='likesectionHead'><a id='x1-1000'></a>Contents</h3>
<div class='tableofcontents'>
<span class='sectionToc'><a id='QQ2-1-2' href='#x1-20001'>1 </a></span>
<br /> <span class='sectionToc'><a id='QQ2-1-3' href='#x1-30002'>2 </a></span>
<br /> <span class='sectionToc'><a id='QQ2-1-4' href='#x1-40003'>3 </a></span>
</div>
~
).