Skip to content

Commit 12745ac

Browse files
committed
Escape leading digit of the anchor id
1 parent 4f28cae commit 12745ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/core/event/scroll.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import {isMobile} from '../util/env'
22
import * as dom from '../util/dom'
33
import Tweezer from 'tweezer.js'
4+
import cssEscape from 'css.escape'
45

56
const nav = {}
67
let hoverOver = false
@@ -131,7 +132,7 @@ export function scrollIntoView(path, id) {
131132
return
132133
}
133134

134-
const section = dom.find('#' + id)
135+
const section = dom.find('#' + cssEscape(id))
135136
section && scrollTo(section)
136137

137138
const li = nav[getNavKey(path, id)]

0 commit comments

Comments
 (0)