Fix duplicated headers anchor link not been updated properly

This commit is contained in:
Wu Cheng-Han 2017-02-03 22:02:12 +08:00
parent 7863eec366
commit 1a617ddf2e

View file

@ -833,7 +833,7 @@ export function deduplicatedHeaderId(view) {
const newId = id + j; const newId = id + j;
const $duplicatedHeader = $(duplicatedHeaders[j]); const $duplicatedHeader = $(duplicatedHeaders[j]);
$duplicatedHeader.attr('id', newId); $duplicatedHeader.attr('id', newId);
const $headerLink = $duplicatedHeader.find('> .header-link'); const $headerLink = $duplicatedHeader.find(`> a.anchor[href="#${id}"]`);
$headerLink.attr('href', `#${newId}`); $headerLink.attr('href', `#${newId}`);
$headerLink.attr('title', newId); $headerLink.attr('title', newId);
} }