Fix #4720: Pixiv commentary links all create invalid urls.

Regression caused by the switch from the mobile API to the Ajax API. In
the Ajax API, commentaries have /jump.php?<url> links that we have to strip out.
This commit is contained in:
evazion
2021-02-13 17:41:01 -06:00
parent 39cc3ed5cf
commit 23a06aff1d
2 changed files with 21 additions and 1 deletions

View File

@@ -196,6 +196,21 @@ module Sources
dtext_desc = %(foo 【[b]pixiv #46337015 "»":[/posts?tags=pixiv%3A46337015][/b]】bar 【[b]pixiv #14901720 "»":[/posts?tags=pixiv%3A14901720][/b]】\n\nbaz【[b]"user/83739":[https://www.pixiv.net/users/83739] "»":[/artists?search%5Burl_matches%5D=https%3A%2F%2Fwww.pixiv.net%2Fusers%2F83739][/b]】)
assert_equal(dtext_desc, @site.dtext_artist_commentary_desc)
end
should "convert jump.php links" do
get_source("https://www.pixiv.net/en/artworks/68955584")
dtext_desc = <<~EOS
([b]pixiv #68490887 "»":[/posts?tags=pixiv%3A68490887][/b])を一部加筆して再版しました。通販在庫復活しているのでよろしければ▷<https://www.melonbooks.co.jp/detail/detail.php?product_id=364421>
 13
pixivFANBOX開設してみました稿(:˒[]<https://www.pixiv.net/fanbox/creator/143555>
EOS
assert_equal(dtext_desc.chomp, @site.dtext_artist_commentary_desc)
end
end
context "translating the tags" do