Fix #3321: HTML tags not converted in artist commentaries.
This commit is contained in:
@@ -132,7 +132,8 @@ module Sources
|
|||||||
%("user/#{member_id}":[#{profile_url}] "»":[/artists?#{search_params}])
|
%("user/#{member_id}":[#{profile_url}] "»":[/artists?#{search_params}])
|
||||||
end
|
end
|
||||||
|
|
||||||
text
|
text = text.gsub(/\r\n|\r|\n/, "<br>")
|
||||||
|
DText.from_html(text)
|
||||||
end
|
end
|
||||||
|
|
||||||
def illust_id_from_url
|
def illust_id_from_url
|
||||||
|
|||||||
@@ -135,10 +135,17 @@ module Sources
|
|||||||
assert_equal("desc", @site.dtext_artist_commentary_desc)
|
assert_equal("desc", @site.dtext_artist_commentary_desc)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
should "convert html to dtext" do
|
||||||
|
get_source("https://www.pixiv.net/member_illust.php?mode=medium&illust_id=65985331")
|
||||||
|
|
||||||
|
dtext_desc = "[b]bold[/b]\n[i]italic[/i]\nred"
|
||||||
|
assert_equal(dtext_desc, @site.dtext_artist_commentary_desc)
|
||||||
|
end
|
||||||
|
|
||||||
should "convert illust links and member links to dtext" do
|
should "convert illust links and member links to dtext" do
|
||||||
get_source("https://www.pixiv.net/member_illust.php?mode=medium&illust_id=63421642")
|
get_source("https://www.pixiv.net/member_illust.php?mode=medium&illust_id=63421642")
|
||||||
|
|
||||||
dtext_desc = %(foo 【pixiv #46337015 "»":[/posts?tags=pixiv:46337015]】bar 【pixiv #14901720 "»":[/posts?tags=pixiv:14901720]】\r\n\r\nbaz【"user/83739":[https://www.pixiv.net/member.php?id=83739] "»":[/artists?search%5Burl_matches%5D=https%3A%2F%2Fwww.pixiv.net%2Fmember.php%3Fid%3D83739]】)
|
dtext_desc = %(foo 【pixiv #46337015 "»":[/posts?tags=pixiv:46337015]】bar 【pixiv #14901720 "»":[/posts?tags=pixiv:14901720]】\n\nbaz【"user/83739":[https://www.pixiv.net/member.php?id=83739] "»":[/artists?search%5Burl_matches%5D=https%3A%2F%2Fwww.pixiv.net%2Fmember.php%3Fid%3D83739]】)
|
||||||
assert_equal(dtext_desc, @site.dtext_artist_commentary_desc)
|
assert_equal(dtext_desc, @site.dtext_artist_commentary_desc)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user