fix numbering.

This commit is contained in:
mattn
2012-06-11 18:21:05 +09:00
parent edbf970d03
commit 5011ea1dc6
3 changed files with 25 additions and 5 deletions

View File

@@ -47,14 +47,22 @@ function! zencoding#lang#haml#toString(settings, current, type, inline, filters,
let inner = ''
if len(current.value) > 0
let lines = split(current.value[1:-2], "\n")
let text = current.value[1:-2]
let text = substitute(text, '\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
let text = substitute(text, '\${nr}', "\n", 'g')
let text = substitute(text, '\\\$', '$', 'g')
let lines = split(text, "\n")
let str .= " " . lines[0]
for line in lines[1:]
let str .= " |\n" . line
endfor
endif
if len(current.child) == 1 && len(current.child[0].name) == 0
let lines = split(current.child[0].value[1:-2], "\n")
let text = current.child[0].value[1:-2]
let text = substitute(text, '\%(\\\)\@\<!\(\$\+\)\([^{#]\|$\)', '\=printf("%0".len(submatch(1))."d", itemno+1).submatch(2)', 'g')
let text = substitute(text, '\${nr}', "\n", 'g')
let text = substitute(text, '\\\$', '$', 'g')
let lines = split(text, "\n")
let str .= " " . lines[0]
for line in lines[1:]
let str .= " |\n" . line