-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #39 from ndy2/update-tags-regex
update tag regex
- Loading branch information
Showing
7 changed files
with
74 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
from inspect import cleandoc | ||
|
||
from assertpy import assert_that | ||
|
||
from obsidian_support.conversion.tags.tags import TagsConversion | ||
|
||
|
||
def test_tags_conversion_1(): | ||
# given | ||
conversion = TagsConversion() | ||
markdown = "#tag" | ||
|
||
# when | ||
converted = conversion.markdown_convert(markdown, None) | ||
|
||
# then | ||
assert_that(converted).is_equal_to("**tag**{: .hash}") | ||
|
||
|
||
def test_tags_conversion_2(): | ||
# given | ||
conversion = TagsConversion() | ||
markdown = cleandoc(""" | ||
#tag | ||
```tabs | ||
---tab obsidian markdown | ||
~~~ | ||
This is just an #obsidian tag. Click to go to the search bar | ||
~~~ | ||
---tab mkdocs-material rendered | ||
This is just an #obsidian tag. Click to go to the search bar | ||
``` | ||
""") | ||
|
||
# when | ||
converted = conversion.markdown_convert(markdown, None) | ||
|
||
# then | ||
assert_that(converted).is_equal_to(cleandoc(""" | ||
**tag**{: .hash} | ||
```tabs | ||
---tab obsidian markdown | ||
~~~ | ||
This is just an #obsidian tag. Click to go to the search bar | ||
~~~ | ||
---tab mkdocs-material rendered | ||
This is just an **obsidian**{: .hash} tag. Click to go to the search bar | ||
``` | ||
""")) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters