equal
deleted
inserted
replaced
144 r, e := Textify(body) |
144 r, e := Textify(body) |
145 assert.Nil(t, e) |
145 assert.Nil(t, e) |
146 assert.Equal(t, expected, r) |
146 assert.Equal(t, expected, r) |
147 } |
147 } |
148 |
148 |
|
149 func TestTextifyMastodonMention(t *testing.T) { |
|
150 expected := "La tête à @Toto \\o/" |
|
151 |
|
152 body := `<p>La tête à <span class="h-card"><a href="https://example.com/@Toto">@<span>Toto</span></a></span> \o/</p>` |
|
153 |
|
154 r, e := Textify(body) |
|
155 assert.Nil(t, e) |
|
156 assert.Equal(t, expected, r) |
|
157 } |
|
158 |
149 func TestTextifyMastodonMentionAndTag(t *testing.T) { |
159 func TestTextifyMastodonMentionAndTag(t *testing.T) { |
150 expected := "@ACh Mais heu ! Moi aussi je fais du #TootRadio de gens morts il y a 5 siècles. Gesulado, Charpentier, Mireille Mathieu..." |
160 expected := "@ACh Mais heu ! Moi aussi je fais du #TootRadio de gens morts il y a 5 siècles. Gesulado, Charpentier, Mireille Mathieu..." |
151 |
161 |
152 body := `<p><span class="h-card"><a href="https://mamot.fr/@ACh">@<span>ACh</span></a></span> Mais heu ! Moi aussi je fais du <a href="https://example.com/tags/tootradio">#<span>TootRadio</span></a> de gens morts il y a 5 siècles. Gesulado, Charpentier, Mireille Mathieu...</p>` |
162 body := `<p><span class="h-card"><a href="https://mamot.fr/@ACh">@<span>ACh</span></a></span> Mais heu ! Moi aussi je fais du <a href="https://example.com/tags/tootradio">#<span>TootRadio</span></a> de gens morts il y a 5 siècles. Gesulado, Charpentier, Mireille Mathieu...</p>` |
153 |
163 |