We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b23c92 commit d0ffa6fCopy full SHA for d0ffa6f
themes/vue/source/js/common.js
@@ -252,7 +252,16 @@
252
253
function makeLink (h) {
254
var link = document.createElement('li')
255
- var text = h.textContent.replace(/\(.*\)$/, '')
+ window.arst = h
256
+ var text = [].slice.call(h.childNodes).map(function (node) {
257
+ if (node.nodeType === Node.TEXT_NODE) {
258
+ return node.nodeValue
259
+ } else if (['CODE', 'SPAN'].indexOf(node.tagName) !== -1) {
260
+ return node.textContent
261
+ } else {
262
+ return ''
263
+ }
264
+ }).join('').replace(/\(.*\)$/, '')
265
link.innerHTML =
266
'<a class="section-link" data-scroll href="#' + h.id + '">' +
267
htmlEscape(text) +
0 commit comments