+ let chunks = [];
+ if (y in tui.links) {
+ let start_x = 0;
+ for (let span of tui.links[y]) {
+ chunks.push(escapeHTML(line.slice(start_x, span[0])));
+ chunks.push('<a href="');
+ chunks.push(escapeHTML(span[2]));
+ chunks.push('">');
+ chunks.push(escapeHTML(line.slice(span[0], span[1])));
+ chunks.push('</a>');
+ start_x = span[1];
+ }
+ chunks.push(escapeHTML(line.slice(start_x)));
+ } else {
+ chunks = [escapeHTML(line)];
+ }
+ for (const chunk of chunks) {
+ pre_content += chunk;
+ }
+ pre_content += '\n';