One9398 / vimwiki

Automatically exported from code.google.com/p/vimwiki
0 stars 1 forks source link

g:vimwiki_valid_html_tags unexpected result #407

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Let g:vimwiki_valid_html_tags="div"
2. Insert 
     <div class="test">
     = test =
     </div>

What is the expected output? What do you see instead?
I expect the result will be :
<div id="test"> 
<h1 id="toc_2">test</h1>
</div>

The actul result is :
<p>
<div id="test"> 
</p>
<h1 id="toc_2">test</h1>
<p>
</div>
</p>

What version of the product are you using? On what operating system?
2.0.1 vimwiki + vim 7.3 + Linux Mint 14

Please provide any additional information below.

vimwiki treats <div id="test> as a new paragraph and add <p> before the line 
and </p> after the line. This cause browsers can't correctly perform CSS code 
to the div block.

I modified the function "s:process_tag_para(line, para)" in 
autoload/vimwiki/html.vim as following code.
  * Original :
     if a:line =~ '^\s\{,3}\S'                                                                                                                                                                                                                
  * Modified
     if a:line =~ '^<.*>\s*$'
       let processed = 1
       call add(lines, a:line)
     elseif a:line =~ '^\s\{,3}\S'

This code can only work for some circumstances.
Is there any better way to avoid this issue without modifying html.vim?

Original issue reported on code.google.com by feg...@gmail.com on 21 Mar 2013 at 5:14