MCPcopy Index your code
hub / github.com/braziljs/eloquente-javascript / parseData

Function parseData

src/markdown.mjs:4–14  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

2import markdownIt from "markdown-it"
3
4function parseData(str) {
5 let tag = /^\s*(\w+)\s*?/.exec(str), args
6 if (!tag) return null
7 if (tag[0].length == str.length) {
8 args = []
9 } else {
10 try { args = PJSON.parse("[" + str.slice(tag[0].length) + "]") }
11 catch(_) { return null }
12 }
13 return {tag: tag[1], args}
14}
15
16function parseBlockMeta(state, startLine, endLine) {
17 let pos = state.bMarks[startLine] + state.tShift[startLine]

Callers 2

parseBlockMetaFunction · 0.85
parseInlineMetaFunction · 0.85

Calls 2

parseMethod · 0.45
sliceMethod · 0.45

Tested by

no test coverage detected