We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 967cda7 commit 8f2a60eCopy full SHA for 8f2a60e
packages/@vuepress/markdown/lib/snippet.js
@@ -4,6 +4,7 @@ module.exports = function snippet (md, options = {}) {
4
const root = options.root || process.cwd()
5
6
function parser (state, startLine, endLine, silent) {
7
+ const CH = '<'.charCodeAt(0)
8
const pos = state.bMarks[startLine] + state.tShift[startLine]
9
const max = state.eMarks[startLine]
10
@@ -13,8 +14,9 @@ module.exports = function snippet (md, options = {}) {
13
14
return false
15
}
16
- if (!/^<<</.test(state.src)) {
17
- return false
+ for (let i = 0; i < 3; ++i) {
18
+ const ch = state.src.charCodeAt(pos + i)
19
+ if (ch !== CH || pos + i >= max) return false
20
21
22
if (silent) {
0 commit comments