|
@@ -621,10 +621,10 @@ function buildAST(md, mdTags=syntax, offset=0, tree={tag: 'root'}, stack=[]){
|
|
|
const Heading = ({react:React, children, title, node: {tag, startMatch}}) => {
|
|
|
const level = +tag.slice(-1)
|
|
|
const _ = React.createElement.bind(React)
|
|
|
- console.log(startMatch)
|
|
|
+ const [m, m1,m2, id, rest] = startMatch
|
|
|
if (isNaN(level)) throw new SyntaxError('wrong heading name')
|
|
|
return _(React.Fragment, null,
|
|
|
- _(`h${level}`, null, ...title),
|
|
|
+ _(`h${level}`, id && {id}, ...title),
|
|
|
_(`div`, null, ...children)
|
|
|
)
|
|
|
}
|