Replace deprecated String.prototype.substr()
.substr() is deprecated so we replace it with .slice() which works similarily but isn't deprecated Signed-off-by: Tobias Speicher <rootcommander@gmail.com>
This commit is contained in:
parent
6412156210
commit
e0486e49c6
3 changed files with 4 additions and 4 deletions
|
@ -70,7 +70,7 @@ export default class TableOfContents {
|
|||
tocHtml += '<li>';
|
||||
|
||||
// remove parent directory reference from href to fix certain books
|
||||
const link = chapter.href.startsWith('../') ? chapter.href.substr(3) : chapter.href;
|
||||
const link = chapter.href.startsWith('../') ? chapter.href.slice(3) : chapter.href;
|
||||
tocHtml += `<a href="${rendition.book.path.directory + link}">${chapter.label}</a>`;
|
||||
tocHtml += '</li>';
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue