We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 35aa58e commit d0fbb7fCopy full SHA for d0fbb7f
1 file changed
src/app/book/markdown/markdown.service.ts
@@ -269,12 +269,8 @@ export class MarkdownService {
269
return _.data.tocSearch.reduce((acc: Array<string>, __: any): Array<string> => {
270
return __
271
&& (/\.md$/.test(__.url.split('#')[0]))
272
- && (acc.findIndex(path => path === (
273
- /^\//.test(__.url.split('#')[0])
274
- ? __.url.split('#')[0]
275
- : `/${__.url.split('#')[0]}`
276
- )) < 0)
277
- ? [...acc, decodeURI(/^\//.test(__.url.split('#')[0]) ? __.url.split('#')[0] : `/${__.url.split('#')[0]}`)]
+ && (acc.findIndex(path => path === resolve('/', decodeURI(__.url.split('#')[0]))) < 0)
+ ? [...acc, resolve('/', decodeURI(__.url.split('#')[0]))]
278
: acc;
279
}, []) as Array<string>;
280
}),
0 commit comments