import * as markdowIt from 'markdown-it' ; export function plantumlWorker ( state ) { let blockTokens = state . tokens ; for ( let blockToken of blockTokens ) { if ( isPlanUMLImage ( blockToken ) ) { blockToken . type = "plantuml" ; blockToken . tag = "img" ; } } } function isPlanUMLImage ( token ) { if ( token . type !== "fence" ) return false ; let info = token . info . split ( " " ) [ 0 ] ; return info == "plantuml" || info == "puml" || info == "uml" || info == "{plantuml}" || info == "{puml}" || info == "{uml}" ; } function debugInfo ( blockTokens ) { for ( let blockToken of blockTokens ) { console . log ( blockToken . type , blockToken . info , blockToken . tag , blockToken . content ) ; if ( ! blockToken . children ) continue ; for ( let token of blockToken . children ) { console . log ( "children:" , token . type , token . info , token . tag , token . content ) ; } } }