only link in content
field
Some checks failed
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline failed
ci/woodpecker/pr/test Pipeline was successful
Some checks failed
ci/woodpecker/push/release Pipeline was successful
ci/woodpecker/pr/release Pipeline was successful
ci/woodpecker/pr/lint Pipeline was successful
ci/woodpecker/push/lint Pipeline was successful
ci/woodpecker/push/test Pipeline failed
ci/woodpecker/pr/test Pipeline was successful
This commit is contained in:
parent
838b025337
commit
e71a7893ec
2 changed files with 13 additions and 4 deletions
|
@ -86,7 +86,7 @@ defp fix_misskey_content(
|
|||
%{"source" => %{"mediaType" => "text/x.misskeymarkdown", "content" => content}} = object
|
||||
) do
|
||||
{linked, _, _} = Utils.format_input(content, "text/x.misskeymarkdown")
|
||||
put_in(object, ["source", "content"], linked)
|
||||
Map.put(object, "content", linked)
|
||||
end
|
||||
|
||||
defp fix_misskey_content(%{"_misskey_content" => content} = object) do
|
||||
|
@ -94,9 +94,10 @@ defp fix_misskey_content(%{"_misskey_content" => content} = object) do
|
|||
|
||||
object
|
||||
|> Map.put("source", %{
|
||||
"content" => linked,
|
||||
"content" => content,
|
||||
"mediaType" => "text/x.misskeymarkdown"
|
||||
})
|
||||
|> Map.put("content", linked)
|
||||
|> Map.delete("_misskey_content")
|
||||
end
|
||||
|
||||
|
|
|
@ -86,7 +86,11 @@ test "a misskey MFM status with a content field should work and be linked", _ do
|
|||
%{
|
||||
valid?: true,
|
||||
changes: %{
|
||||
source: %{"content" => ^expected_content, "mediaType" => "text/x.misskeymarkdown"}
|
||||
content: ^expected_content,
|
||||
source: %{
|
||||
"content" => "@akkoma_user linkifylink #dancedance $[jelly mfm goes here] \n\n## aaa",
|
||||
"mediaType" => "text/x.misskeymarkdown"
|
||||
}
|
||||
}
|
||||
} = ArticleNotePageValidator.cast_and_validate(note)
|
||||
end
|
||||
|
@ -107,7 +111,11 @@ test "a misskey MFM status with a _misskey_content field should work and be link
|
|||
%{
|
||||
valid?: true,
|
||||
changes: %{
|
||||
source: %{"content" => ^expected_content, "mediaType" => "text/x.misskeymarkdown"}
|
||||
content: ^expected_content,
|
||||
source: %{
|
||||
"content" => "@akkoma_user linkifylink #dancedance $[jelly mfm goes here] \n\n## aaa",
|
||||
"mediaType" => "text/x.misskeymarkdown"
|
||||
}
|
||||
}
|
||||
} = ArticleNotePageValidator.cast_and_validate(note)
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue