mirror of
https://github.com/facebook/docusaurus.git
synced 2025-05-19 03:57:01 +02:00
fix(core): various broken anchor link fixes (#9732)
This commit is contained in:
parent
d94adf6a6c
commit
4388267c26
63 changed files with 345 additions and 115 deletions
|
@ -301,6 +301,29 @@ describe('parseURLPath', () => {
|
|||
});
|
||||
});
|
||||
|
||||
it('parse anchor', () => {
|
||||
expect(parseURLPath('#anchor')).toEqual({
|
||||
pathname: '/',
|
||||
search: undefined,
|
||||
hash: 'anchor',
|
||||
});
|
||||
expect(parseURLPath('#anchor', '/page')).toEqual({
|
||||
pathname: '/page',
|
||||
search: undefined,
|
||||
hash: 'anchor',
|
||||
});
|
||||
expect(parseURLPath('#')).toEqual({
|
||||
pathname: '/',
|
||||
search: undefined,
|
||||
hash: '',
|
||||
});
|
||||
expect(parseURLPath('#', '/page')).toEqual({
|
||||
pathname: '/page',
|
||||
search: undefined,
|
||||
hash: '',
|
||||
});
|
||||
});
|
||||
|
||||
it('parse hash', () => {
|
||||
expect(parseURLPath('/page')).toEqual({
|
||||
pathname: '/page',
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue