mirror of
https://github.com/discourse/discourse.git
synced 2025-05-29 11:48:08 +08:00
UX: Improve style of GitHub PR body in emails (#13198)
On the web, we display only an excerpt in a monospace font and the rest of the body is hidden under ellipsis. The email displayed both of them and it did not use the same style. This commit leaves only the excerpt in emails and makes it use a monospace font to display it.
This commit is contained in:
@ -185,6 +185,15 @@ describe Email::Styles do
|
||||
fragment = html_fragment('<aside class="quote"> <div class="title"> <div class="quote-controls"> <i class="fa fa-chevron-down" title="expand/collapse"></i><a href="/t/xyz/123" title="go to the quoted post" class="back"></a> </div> <img alt="" width="20" height="20" src="https://cdn-enterprise.discourse.org/boingboing/user_avatar/bbs.boingboing.net/techapj/40/54379_1.png" class="avatar">techAPJ: </div> <blockquote> <p>lorem ipsum</p> </blockquote> </aside>')
|
||||
expect(fragment.to_s.squish).to match(/^<blockquote.+<\/blockquote>$/)
|
||||
end
|
||||
|
||||
it "removes GitHub excerpts" do
|
||||
stub_request(:head, "https://github.com/discourse/discourse/pull/1253").to_return(status: 200, body: "", headers: {})
|
||||
stub_request(:get, "https://api.github.com/repos/discourse/discourse/pulls/1253").to_return(status: 200, body: onebox_response("githubpullrequest"))
|
||||
|
||||
onebox = Oneboxer.onebox("https://github.com/discourse/discourse/pull/1253")
|
||||
fragment = html_fragment(onebox)
|
||||
expect(fragment.css(".github-body-container .excerpt")).to be_empty
|
||||
end
|
||||
end
|
||||
|
||||
context "replace_secure_media_urls" do
|
||||
|
Reference in New Issue
Block a user