diff --git a/autoload/emmet/lang/html.vim b/autoload/emmet/lang/html.vim
index e536de0..1468c6c 100644
--- a/autoload/emmet/lang/html.vim
+++ b/autoload/emmet/lang/html.vim
@@ -340,6 +340,16 @@ function! emmet#lang#html#parseIntoTree(abbr, type)
return root
endfunction
+function! s:dollar_add(base,no)
+ if a:base > 0
+ return a:base + a:no - 1
+ elseif a:base < 0
+ return a:base - a:no + 1
+ else
+ return a:no
+ endif
+endfunction
+
function! emmet#lang#html#toString(settings, current, type, inline, filters, itemno, indent)
let settings = a:settings
let current = a:current
@@ -370,10 +380,11 @@ function! emmet#lang#html#toString(settings, current, type, inline, filters, ite
let text = current.value[1:-2]
if dollar_expr
" TODO: regexp engine specified
+ let nr = itemno + 1
if exists('®expengine')
- let text = substitute(text, '\%#=1\%(\\\)\@\