Bug 27336: Sanitize correctly HTML id
Valid characters are alphanumeric characters (a-zA-Z0-9), hyphen (-)
and underscore (_)
https://www.w3.org/TR/CSS21/syndata.html#value-def-identifier
All invalid characters will be replaced by '_'
Test plan:
1. Go to Administration ยป System preferences and click on 'Searching'
tab
2. You should see a console error (Uncaught Error: Syntax error,
unrecognized expression: #collapse_Did_you_mean/spell_checking)
3. Apply patch
4. Make sure the error is gone
5. prove t/Koha_Template_Plugin_HtmlId.t
Signed-off-by: Owen Leonard <oleonard@myacpl.org>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
(cherry picked from commit
d89f6027be001d537b0eb73ea3fb4641d5fcd292)
Signed-off-by: Fridolin Somers <fridolin.somers@biblibre.com>