fix: Cannot read property 'tagName' of null by woshiguabi · Pull Request #1655 · docsifyjs/docsify

Summary

Have a look at this issue #1154 .
https://codesandbox.io/s/loving-matsumoto-hp985?file=/index.html
Open devtools and click the blank space of svg(not path) will reproduce this issue.

parentNode may be null.
https://github.com/docsifyjs/docsify/blob/develop/src/core/router/history/html5.js#L25-L27

However, hash router has been fixed in #1308 😜.
https://github.com/docsifyjs/docsify/blob/develop/src/core/router/history/hash.js#L47-L49

What kind of change does this PR introduce?

For any code change,

  • Related documentation has been updated if needed
  • Related tests have been updated or tests have been added

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing applications:

Related issue, if any:

#1154

Tested in the following browsers:

  • Chrome
  • Firefox
  • Safari
  • Edge
  • IE