mirror of
https://github.com/discourse/discourse.git
synced 2025-06-04 10:24:39 +08:00
FEATURE: option to enable inline oneboxes for all domains
Also, change to prefer title over open graph which is often way too sparse
This commit is contained in:
@ -21,11 +21,22 @@ describe RetrieveTitle do
|
||||
expect(title).to eq("Another Title")
|
||||
end
|
||||
|
||||
it "will pick og:title if title is missing" do
|
||||
title = RetrieveTitle.extract_title(<<~HTML
|
||||
<html>
|
||||
<meta property="og:title" content="Good Title"
|
||||
</html>
|
||||
HTML
|
||||
)
|
||||
|
||||
expect(title).to eq("Good Title")
|
||||
end
|
||||
|
||||
it "will prefer the title from an opengraph tag" do
|
||||
title = RetrieveTitle.extract_title(<<~HTML
|
||||
<html>
|
||||
<title>Bad Title</title>
|
||||
<meta property="og:title" content="Good Title" />
|
||||
<title>Good Title</title>
|
||||
<meta property="og:title" content="Bad Title"
|
||||
</html>
|
||||
HTML
|
||||
)
|
||||
|
Reference in New Issue
Block a user