You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Would it be possible to escape existing comments in html/xml differently than it is implemented now?
The problem is that the generated xml code is invalid if comments already exist in the file, because -- characters in a commented part are invalid.
@szebenyib
Same problem here, vim-commentary is great, but for xml a little bit useless because of not-valid nested-comments. I wrote a small workaround, maybe it is helpfull!
augroup Xml
command! ValidComment execute "normal! mtvat\<esc>`<:'<,'>s/<1!--/<1!__/ge\<cr>:'<,'>s/--1>/__1>/ge\<cr>:nohlsearch\<cr>"
command! ValidUncomment execute "normal! mtvat\<esc>`<:'<,'>s/<1!__/<!--/ge\<cr>:'<,'>s/__1>/-->/ge\<cr>:nohlsearch\<cr>"
nnoremap <leader>vc :ValidComment<cr>
nnoremap <leader>vu :ValidUncomment<cr>
augroup END
@tpope
Sorry for my bad knowledge of VimL, I'm just a beginner with Vim, I'm sure there is a better solution!
Hi!
Would it be possible to escape existing comments in html/xml differently than it is implemented now?
The problem is that the generated xml code is invalid if comments already exist in the file, because -- characters in a commented part are invalid.
Example:
<!-- something -->
becomes
<!-- <1-- something --1> -->
It would be nice if the following happened:
Example:
<!-- something -->
becomes
<!-- <1__ something __1> -->
This renders the page invalid and invalidity completely denies rendering of the file.
The text was updated successfully, but these errors were encountered: