src/markdown/to_markdown.js
// Render the contents of `parent` as inline content.
Render the contents of `parent` as inline content.
Render the contents of ` parent ` as inline content .
renderInline(parent) {
    let stack = []
    let progress = node => {
      let marks = node ? node.marks.slice() : []
      if (stack.length && stack[stack.length - 1].type == "code" &&
          (!marks.length || marks[marks.length - 1].type != "code")) {
        this.text("`", false)
        stack.pop()
      }
      for (let j = 0; j < stack.length; j++) {
        let cur = stack[j], found = false
        for (let k = 0; k < marks.length; k++) {
          if (marks[k].eq(stack[j])) {
            marks.splice(k, 1)
            found = true
            break
          }
        }
        if (!found) {
          this.text(this.markString(cur, false), false)
          stack.splice(j--, 1)
        }
      }
      for (let j = 0; j < marks.length; j++) {
        let cur = marks[j]
        stack.push(cur)
        this.text(this.markString(cur, true), false)
      }
      if (node) this.render(node)
    }
    parent.forEach(progress)
    progress(null)
  }
renderInline ( parent ) { let stack = [ ] let progress = node => { let marks = node ? node . marks . slice ( ) : [ ] if ( stack . length && stack [ stack . length - 1 ] . type == "code" && ( ! marks . length || marks [ marks . length - 1 ] . type != "code" ) ) { this . text ( "`" , false ) stack . pop ( ) } for ( let j = 0 ; j < stack . length ; j ++ ) { let cur = stack [ j ] , found = false for ( let k = 0 ; k < marks . length ; k ++ ) { if ( marks [ k ] . eq ( stack [ j ] ) ) { marks . splice ( k , 1 ) found = true break } } if ( ! found ) { this . text ( this . markString ( cur , false ) , false ) stack . splice ( j -- , 1 ) } } for ( let j = 0 ; j < marks . length ; j ++ ) { let cur = marks [ j ] stack . push ( cur ) this . text ( this . markString ( cur , true ) , false ) } if ( node ) this . render ( node ) } parent . forEach ( progress ) progress ( null ) }
Render the contents of `parent` as inline content.
Render the contents of ` parent ` as inline content .