Skip to content
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

Use MetaInspector's best guess on page title when generating Non-OGP preview #39

Merged
merged 4 commits into from
Jan 28, 2023

Conversation

Clpsplug
Copy link
Contributor

Closes #38.

This PR changes the behavior of NonOpenGraphPropertiesFactory so that the title can be found even if the page doesn't write its <title> within its <head>. To be specific, one of the following elements will be used as the page title (if more than one is found, the earliest in this list is used:)

  • <meta property='title' ...>
  • <meta property='og:title' ...>
  • <title> within <head>
  • <title> within <body>
  • The first <h1> element within the page

Copy link
Owner

@ysk24ok ysk24ok left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@ysk24ok
Copy link
Owner

ysk24ok commented Jan 28, 2023

Hmm, maybe because the test workflow doesn't have on.pull_request field, CI doesn't run for this PR.
Merging this anyway it looks OK.

@ysk24ok ysk24ok merged commit 3a52b64 into ysk24ok:master Jan 28, 2023
@Clpsplug Clpsplug deleted the feature/use_best_title_guess branch January 28, 2023 11:43
This was referenced Jan 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Non-HTML spec compliant pages cause plugin to miss crucial elements
2 participants