-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pages with meta tags, all of whose property attr are unrelated to OG properties ruins the preview #37
Comments
I also noticed that this specific page has quite a unique structure - the We cannot blame them, though; having a But there is an alternative: the jekyll-linkpreview/lib/jekyll-linkpreview.rb Lines 117 to 121 in 61c8b0b
I'm going to prep a PR, but should the 'using |
Thank you for reporting this.
Right. We should check these four properties as https://ogp.me/#metadata says they are required for every page.
I think so, and could you put #37 (comment) as a new issue so a PR can close the corresponding issue? |
The issue
I attempted to
linkpreview
the following URL:https://docs.unity3d.com/Packages/com.unity.inputsystem@1.0/api/UnityEngine.InputSystem.InputSystem.html
It is a documentation page for Unity's package.
Expected behavior
This link does not appear to have any OGP properties, so I expected this plugin to produce a "no OGP image link preview snippet" with the title
Class InputSystem | Input System | 1.0.2
.Actual behavior
This happened.
linkpreview.html
) even though there are no OG properties on this pageI looked into the cache and found that the corresponding file had this:
(filename: cec2702fa0dbc6125ac754817ddbb10b.json)
Suspected issues
This page has these
<meta>
tags in its HTML:So this page has
<meta>
tags with aproperty
attribute, but its value is neverog:.*
. This edge case of an HTML page causes this method to miss this case and causes it to spawnOpenGraphPropertiesFactory
when it should be spawningNonOpenGraphPropertiesFactory
instead.jekyll-linkpreview/lib/jekyll-linkpreview.rb
Lines 190 to 198 in 61c8b0b
(Any
<meta>
tag whose property attribute value matchesog:.*
on this page and the plugin would have avoided this issue.)Potential fix
In addition to
page.meta_tags['property'].empty?
, check for the total absence ofproperty
attributes whose value matches regexog:.*
. If any of those holds, we should useNonOpenGraphPropertiesFactory
.The text was updated successfully, but these errors were encountered: