@@ -36,7 +36,7 @@ const DOC_CREATED_REG_EXP = /<!--\s*introduced_in\s*=\s*v([0-9]+)\.([0-9]+)\.([0 |
36 | 36 | // customized heading without id attribute |
37 | 37 | const renderer = new marked.Renderer(); |
38 | 38 | renderer.heading = function(text, level) { |
39 | | - return '<h' + level + '>' + text + '</h' + level + '>\n'; |
| 39 | + return `<h${level}>${text}</h${level}>\n`; |
40 | 40 | }; |
41 | 41 | marked.setOptions({ |
42 | 42 | renderer: renderer |
@@ -107,7 +107,7 @@ function loadGtoc(cb) { |
107 | 107 | if (err) return cb(err); |
108 | 108 |
|
109 | 109 | data = marked(data).replace(/<a href="(.*?)"/gm, function(a, m) { |
110 | | - return '<a class="nav-' + toID(m) + '" href="' + m + '"'; |
| 110 | + return `<a class="nav-${toID(m)}" href="${m}"`; |
111 | 111 | }); |
112 | 112 | return cb(null, data); |
113 | 113 | }); |
@@ -152,7 +152,7 @@ function render(opts, cb) { |
152 | 152 | template = template.replace(/__TOC__/g, toc); |
153 | 153 | template = template.replace( |
154 | 154 | /__GTOC__/g, |
155 | | - gtocData.replace('class="nav-' + id, 'class="nav-' + id + ' active') |
| 155 | + gtocData.replace(`class="nav-${id}`, `class="nav-${id} active`) |
156 | 156 | ); |
157 | 157 |
|
158 | 158 | if (opts.analytics) { |
@@ -500,8 +500,8 @@ function buildToc(lexed, filename, cb) { |
500 | 500 | const realFilename = path.basename(realFilenames[0], '.md'); |
501 | 501 | const id = getId(realFilename + '_' + tok.text.trim()); |
502 | 502 | toc.push(new Array((depth - 1) * 2 + 1).join(' ') + |
503 | | - '* <span class="stability_' + tok.stability + '">' + |
504 | | - '<a href="#' + id + '">' + tok.text + '</a></span>'); |
| 503 | + `* <span class="stability_${tok.stability}">` + |
| 504 | + `<a href="#${id}">${tok.text}</a></span>`); |
505 | 505 | tok.text += '<span><a class="mark" href="#' + id + '" ' + |
506 | 506 | 'id="' + id + '">#</a></span>'; |
507 | 507 | }); |
|