On Mon, May 19, 2025 at 09:35:31PM +0100, Gavin Smith wrote: > On Tue, May 13, 2025 at 04:28:28PM +0200, Vincent Lefevre wrote: > > "texi2any --html --no-split" generates many accesskey attributes > > with the same value. This does not make sense. In particular, the > > behavior in such a case depends on the web browser: > > > > https://www.w3schools.com/TAGs/att_accesskey.asp > > > > I don't know whether this is possible (this may require Javascript), > > but access keys should be related to the current position. > > > > Thanks for the report. I suppose we should avoid outputting the accesskey > attribute for non-split output.
I do not have a good feeling on that, even if there are many accesskeys, on the one hand the browser may do something sensible with them, on the other hand, we do not want to test the behaviour of all the browsers. > The output of the accesskey attribute can be turned off with > "texi2any -c USE_ACCESSKEY=0". > > The following seems to work for the non-XS code: > > diff --git a/tta/perl/Texinfo/Convert/HTML.pm > b/tta/perl/Texinfo/Convert/HTML.pm > index c68559c7eb..3435405254 100644 > --- a/tta/perl/Texinfo/Convert/HTML.pm > +++ b/tta/perl/Texinfo/Convert/HTML.pm > @@ -9247,6 +9247,13 @@ sub converter_initialize($) > $self->force_conf('SPLIT', 'node'); > } > > + if (!$split) { > + my $use_accesskey = $self->get_conf('USE_ACCESSKEY'); > + if ($use_accesskey) { > + $self->force_conf('USE_ACCESSKEY', 0); > + } > + } > + > my $max_header_level = $self->get_conf('MAX_HEADER_LEVEL'); > if (!defined($max_header_level)) { > $self->force_conf('MAX_HEADER_LEVEL', $defaults{'MAX_HEADER_LEVEL'}); > > (Similar code would also be needed for the XS code.) > > Of course, this makes it impossible to turn USE_ACCESSKEY on deliberately, > which may or may not be a good thing. For such cases, I prefer to turn the default value to undef, and then, if undef, set based on the SPLIT value, if not undef, obey. If this is ok with that change, I could do the patch today or tomorrow. -- Pat