pull/20/head
Thomas Sileo 2019-04-10 23:43:41 +02:00
rodzic 4efec8e74c
commit b4751b1bd2
2 zmienionych plików z 5 dodań i 3 usunięć

Wyświetl plik

@ -37,7 +37,9 @@ def hashtagify(content: str) -> Tuple[str, List[Dict[str, str]]]:
return content, tags
def mentionify(content: str, hide_domain: bool = False) -> Tuple[str, List[Dict[str, str]]]:
def mentionify(
content: str, hide_domain: bool = False
) -> Tuple[str, List[Dict[str, str]]]:
tags = []
for mention in re.findall(MENTION_REGEX, content):
_, username, domain = mention.split("@")

Wyświetl plik

@ -41,8 +41,8 @@ def test_little_content_helper_mention(_):
content, tags = content_helper.parse_markdown("hello @dev@microblog.pub")
assert content == (
'<p>hello <span class="h-card"><a href="https://microblog.pub" class="u-url mention">@<span>dev</span></a>'
"</span></p>"
'<p>hello <span class="h-card"><a href="https://microblog.pub" class="u-url mention">@<span>dev</span>'
"@<span>microblog.pub</span></a></span></p>"
)
assert tags == [
{