Class: MarkdownIt::RulesBlock::Code
- Inherits:
-
Object
- Object
- MarkdownIt::RulesBlock::Code
- Defined in:
- lib/motion-markdown-it/rules_block/code.rb
Class Method Summary collapse
-
.code(state, startLine, endLine, silent = true) ⇒ Object
——————————————————————————.
Class Method Details
.code(state, startLine, endLine, silent = true) ⇒ Object
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/motion-markdown-it/rules_block/code.rb', line 8 def self.code(state, startLine, endLine, silent = true) return false if (state.tShift[startLine] - state.blkIndent < 4) last = nextLine = startLine + 1 while nextLine < endLine if state.isEmpty(nextLine) nextLine += 1 next end if (state.tShift[nextLine] - state.blkIndent >= 4) nextLine += 1 last = nextLine next end break end state.line = nextLine token = state.push('code_block', 'code', 0) token.content = state.getLines(startLine, last, 4 + state.blkIndent, true) token.map = [ startLine, state.line ] return true end |