diff options
author | Vitaly Takmazov | 2019-01-21 14:49:07 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-01-21 14:49:07 +0300 |
commit | 41b6764be12c2b21f0de55b8a80091e279577ab5 (patch) | |
tree | df077502841f2e93820522ab9db999bf091dd9c5 /src/test/java/com/juick/MessageTest.java | |
parent | a125a8d20c8a95bc877e14716318d6df08622af5 (diff) |
ActivityPub: convert HTML to Markdown
Diffstat (limited to 'src/test/java/com/juick/MessageTest.java')
-rw-r--r-- | src/test/java/com/juick/MessageTest.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/test/java/com/juick/MessageTest.java b/src/test/java/com/juick/MessageTest.java index 4c37a678..2d12a3df 100644 --- a/src/test/java/com/juick/MessageTest.java +++ b/src/test/java/com/juick/MessageTest.java @@ -20,6 +20,8 @@ package com.juick; import com.juick.model.Entity; import com.juick.test.util.MockUtils; import com.juick.util.MessageUtils; +import com.overzealous.remark.Options; +import com.overzealous.remark.Remark; import org.apache.commons.lang3.RandomUtils; import org.apache.commons.lang3.StringUtils; import org.junit.Test; @@ -196,4 +198,12 @@ public class MessageTest { assertThat(yo.getStart(), is(0)); assertThat(yo.getEnd(), is(7)); } + @Test + public void ActivityStreamsHTMLtoMarkdownTest() { + String text = "<p><span class=\"h-card\"><a href=\"https://juick.com/stanislavv/\" class=\"u-url mention\">@<span>stanislavv</span></a></span> я в <span class=\"h-card\"><a href=\"https://mastodonsocial.ru/@rf\" class=\"u-url mention\">@<span>rf</span></a></span> выкладывал =)</p>"; + Options options = new Options(); + options.inlineLinks = true; + Remark remark = new Remark(options); + String parsed = remark.convertFragment(text); + } } |