Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #895 #896

Merged
merged 3 commits into from
Feb 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
"chokidar": "^3.2.1",
"conventional-changelog-cli": "^2.0.25",
"cross-env": "^6.0.3",
"css.escape": "^1.5.1",
"cssnano": "^4.1.10",
"eslint": "^5.16.0",
"eslint-config-xo-space": "^0.21.0",
Expand Down
3 changes: 2 additions & 1 deletion src/core/event/scroll.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import {isMobile} from '../util/env'
import * as dom from '../util/dom'
import Tweezer from 'tweezer.js'
import cssEscape from 'css.escape'

const nav = {}
let hoverOver = false
Expand Down Expand Up @@ -131,7 +132,7 @@ export function scrollIntoView(path, id) {
return
}

const section = dom.find('#' + id)
const section = dom.find('#' + cssEscape(id))
section && scrollTo(section)

const li = nav[getNavKey(path, id)]
Expand Down
1 change: 0 additions & 1 deletion src/core/render/slugify.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ export function slugify(str) {
.replace(re, '')
.replace(/\s/g, '-')
.replace(/-+/g, '-')
.replace(/^(\d)/, '_$1')
let count = cache[slug]

count = hasOwn.call(cache, slug) ? count + 1 : 0
Expand Down