Add multiline comment support via %%+ and +%%

This commit is contained in:
Chip Senkbeil
2020-08-01 00:12:21 -05:00
committed by Tinmarino
parent 321e518fdb
commit 6dff2c60a5
8 changed files with 154 additions and 7 deletions

View File

@ -4,8 +4,54 @@ Execute (Copy Wiki's Resources):
Log "Start: Copy Resources"
call CopyResources()
#################################################
Given vimwiki (Comments):
This is some text
%% This is a comment
Test%%+INLINE COMMENT+%%1
%%+INLINE COMMENT+%%Test2
Test3%%+INLINE COMMENT+%%
%%+ Multiline
comment
that
is
removed
+%%
Final text
Do (Convert):
:call ConvertWiki2Html()\<Cr>
# Keep only body
ggd/<body>\<Cr>
Expect (Comments Removed):
<body>
<p>
This is some text
Test1
Test2
Test3
</p>
<p>
Final text
</p>
</body>
</html>
Execute(Delete):
call DeleteFile('$HOME/testwiki/test_html_table.wiki')
call DeleteFile('$HOME/html/default/test_html_table.html')
#################################################
Given vimwiki (Table no heading {{{1):
| header1 | header2 |
| val1 | val2 |
@ -127,7 +173,6 @@ Execute(Delete):
call DeleteFile('$HOME/testwiki/test_html_table.wiki')
call DeleteFile('$HOME/html/default/test_html_table.html')
#################################################
Execute (Log):
Log '#473: Syntax "local:" doesnt work as expected. #473'
@ -174,11 +219,11 @@ Do (Get Html body):
Expect (Local link):
<body>
<p>
<a href="../../here">Link</a>
</p>
</body>
@ -226,7 +271,7 @@ Do (Get Html body):
Expect (Plain Html):
# the whole default html file should be here as a base + the modifications
# the whole default html file should be here as a base + the modifications
# from "Given"
<body>

View File

@ -171,6 +171,47 @@ Execute (Assert Syntax Header):
AssertEqual SyntaxAt(5, 10), 'VimwikiHeader5'
AssertEqual SyntaxAt(6, 10), 'VimwikiHeader6'
# 10 Comments {{{1
###############
Given vimwiki (%%):
%% This is a line comment
%% This is also a comment
Execute (Set syntax default):
call SetSyntax('default')
Execute (Assert Syntax VimwikiComment):
AssertEqual SyntaxAt(1, 1), 'VimwikiComment'
AssertEqual SyntaxAt(2, 4), 'VimwikiComment'
Given vimwiki (%%+, +%%):
%%+ This
is a
multiline
comment +%%
%%+ This is a comment on one line +%%
%%+ One +%% Not a comment %%+ Two +%% Not a comment
Execute (Set syntax default):
call SetSyntax('default')
Execute (Assert Syntax VimwikiMultilineComment):
AssertEqual SyntaxAt(1, 1), 'VimwikiMultilineComment'
AssertEqual SyntaxAt(1, 8), 'VimwikiMultilineComment'
AssertEqual SyntaxAt(2, 1), 'VimwikiMultilineComment'
AssertEqual SyntaxAt(3, 1), 'VimwikiMultilineComment'
AssertEqual SyntaxAt(4, 1), 'VimwikiMultilineComment'
AssertEqual SyntaxAt(5, 1), 'VimwikiMultilineComment'
AssertEqual SyntaxAt(6, 1), 'VimwikiMultilineComment'
AssertEqual SyntaxAt(6, 11), 'VimwikiMultilineComment'
AssertEqual SyntaxAt(6, 12), ''
AssertEqual SyntaxAt(6, 26), ''
AssertEqual SyntaxAt(6, 27), 'VimwikiMultilineComment'
AssertEqual SyntaxAt(6, 37), 'VimwikiMultilineComment'
AssertEqual SyntaxAt(6, 38), ''
AssertEqual SyntaxAt(6, 51), ''
# 10 Code {{{1
# 10.1 Code Indent (4 spaces) {{{2