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:
Sam
2017-08-02 14:27:21 -04:00
parent 582ae9ab8d
commit f6bc572fb8
6 changed files with 43 additions and 11 deletions

View File

@ -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
)