Skip to content
This repository was archived by the owner on Apr 26, 2024. It is now read-only.

Ignore <noscript> tags when generating URL preview descriptions#2576

Merged
ara4n merged 1 commit into
matrix-org:developfrom
maximevaillancourt:exclude-noscript-url-preview
Nov 7, 2017
Merged

Ignore <noscript> tags when generating URL preview descriptions#2576
ara4n merged 1 commit into
matrix-org:developfrom
maximevaillancourt:exclude-noscript-url-preview

Conversation

@maximevaillancourt

Copy link
Copy Markdown

What are you trying to do with this PR?

Exclude content in <noscript> tags from appearing in URL preview descriptions when there is no og:description meta tag on the page behind said URL.

Why are you going with this approach?

Most websites use <noscript> tags to display a message along the lines of "JavaScript is required to view this page. Please enable JavaScript and try again.". Since such a tag is usually the first child of the <body> element, Synapse picks up these words to approximate the page preview description. By excluding <noscript> tags, Synapse is more likely to end up using words that are actually relevant to the page content.

@matrixbot

Copy link
Copy Markdown
Member

Can one of the admins verify this patch?

2 similar comments
@matrixbot

Copy link
Copy Markdown
Member

Can one of the admins verify this patch?

@matrixbot

Copy link
Copy Markdown
Member

Can one of the admins verify this patch?

@erikjohnston

Copy link
Copy Markdown
Member

@matrixbot ok to test

@erikjohnston

Copy link
Copy Markdown
Member

@ara4n happy with this?

@ara4n

ara4n commented Nov 7, 2017

Copy link
Copy Markdown
Member

ecstatically - thanks @maximevaillancourt; sorry it took us a while to review!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants