aboutsummaryrefslogtreecommitdiff
path: root/doc/ref/javascript/user-additions.texi
blob: 706b1dd4504c0f75c93565fcba374c95cd2b3996 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
@node user-additions.js
@section user-additions.js

Some things in the JavaScript code is built to be user-extendable.
The HTML-page attempts to load @code{/static/user/user-additions.js}.


Currently; this only entails @ref{formatters}, where you could, for
example, parse all HTTP-links in a description.

@example
window.formatters.set('description', (el, d) => @{
    el.innerHTML = d.replaceAll(/https?:\/\/\S+/g, '<a href="$&">$&</a>');
@})
@end example

Remember that the documents are X-HTML, so be @emph{extremely} careful
with innerHTML.