@@ -159,3 +159,75 @@ def test_override_default_virtual_tags_positive_without_forcing(self, test_synta
159159 assert port .defaults == {'project' :'Home' }
160160 assert port .sort == DEFAULT_SORT_ORDER
161161 assert port .tw == 'default'
162+
163+ def test_vimwiki_link_as_header_name_simple (self , test_syntax ):
164+ if test_syntax [0 ] == 'default' :
165+ example_viewport = "HEADER2([[Test|https://www.vim.org]] | project:Home)"
166+ elif test_syntax [0 ] == 'markdown' :
167+ example_viewport = "HEADER2([Test](https://www.vim.org) | project:Home)"
168+
169+ port = self .process_viewport (example_viewport , test_syntax )
170+
171+ assert port .taskfilter == list (DEFAULT_VIEWPORT_VIRTUAL_TAGS ) + ["(" , "project:Home" , ")" ]
172+
173+ if test_syntax [0 ] == 'default' :
174+ assert port .name == "[[Test|https://www.vim.org]]"
175+ elif test_syntax [0 ] == 'markdown' :
176+ assert port .name == "[Test](https://www.vim.org)"
177+
178+ assert port .defaults == {'project' :'Home' }
179+ assert port .sort == DEFAULT_SORT_ORDER
180+ assert port .tw == 'default'
181+
182+ def test_vimwiki_link_as_header_name_with_defaults (self , test_syntax ):
183+ if test_syntax [0 ] == 'default' :
184+ example_viewport = "HEADER2([[Test|https://www.vim.org]] | project:Home)"
185+ elif test_syntax [0 ] == 'markdown' :
186+ example_viewport = "HEADER2([Test](https://www.vim.org) | project:Home)"
187+
188+ port = self .process_viewport (example_viewport , test_syntax )
189+
190+ assert port .taskfilter == list (DEFAULT_VIEWPORT_VIRTUAL_TAGS ) + ["(" , "project:Home" , ")" ]
191+ if test_syntax [0 ] == 'default' :
192+ assert port .name == "[[Test|https://www.vim.org]]"
193+ elif test_syntax [0 ] == 'markdown' :
194+ assert port .name == "[Test](https://www.vim.org)"
195+ assert port .defaults == {'project' :'Home' }
196+ assert port .sort == DEFAULT_SORT_ORDER
197+ assert port .tw == 'default'
198+
199+ def test_vimwiki_link_in_header_name_simple (self , test_syntax ):
200+ if test_syntax [0 ] == 'default' :
201+ example_viewport = "HEADER2(Link to [[this|https://www.vim.org]] | project:Home)"
202+ elif test_syntax [0 ] == 'markdown' :
203+ example_viewport = "HEADER2(Link to [this](https://www.vim.org) | project:Home)"
204+
205+ port = self .process_viewport (example_viewport , test_syntax )
206+
207+ assert port .taskfilter == list (DEFAULT_VIEWPORT_VIRTUAL_TAGS ) + ["(" , "project:Home" , ")" ]
208+
209+ if test_syntax [0 ] == 'default' :
210+ assert port .name == "Link to [[this|https://www.vim.org]]"
211+ elif test_syntax [0 ] == 'markdown' :
212+ assert port .name == "Link to [this](https://www.vim.org)"
213+
214+ assert port .defaults == {'project' :'Home' }
215+ assert port .sort == DEFAULT_SORT_ORDER
216+ assert port .tw == 'default'
217+
218+ def test_vimwiki_link_in_header_name_with_defaults (self , test_syntax ):
219+ if test_syntax [0 ] == 'default' :
220+ example_viewport = "HEADER2(Link to [[this|https://www.vim.org]] | project:Home)"
221+ elif test_syntax [0 ] == 'markdown' :
222+ example_viewport = "HEADER2(Link to [this](https://www.vim.org) | project:Home)"
223+
224+ port = self .process_viewport (example_viewport , test_syntax )
225+
226+ assert port .taskfilter == list (DEFAULT_VIEWPORT_VIRTUAL_TAGS ) + ["(" , "project:Home" , ")" ]
227+ if test_syntax [0 ] == 'default' :
228+ assert port .name == "Link to [[this|https://www.vim.org]]"
229+ elif test_syntax [0 ] == 'markdown' :
230+ assert port .name == "Link to [this](https://www.vim.org)"
231+ assert port .defaults == {'project' :'Home' }
232+ assert port .sort == DEFAULT_SORT_ORDER
233+ assert port .tw == 'default'
0 commit comments