Page MenuHomePhabricator

Plugin detect links
Closed, ResolvedPublic

Description

Context

As a Wikipedia Preview partner
I want the option to enable Wikipedia Preview on links
So I don't have to wait for more complex features

Acceptance criteria

  • When Wikipedia links exist on a page (or always, if that conditional is not possible) the plugin loads the wikipediaPreview.production.js file and initializes it with the following options
    • root: document.querySelector('.entry-content')
    • detectLinks: true

Notes

The goal of this task is to be able to release a working plugin quickly before we deal with the custom editors. We need to think of a migration path between this version and the next so it keeps working if we stop detecting links by default. We could save a hidden setting for it.

Event Timeline

SBisson triaged this task as Medium priority.Apr 13 2021, 10:33 AM

I removed the lang init param from the task description. When we detect links, we use the language in the URLs.

how can I test this?

You install and activate the plugin in WordPress. Write an article with some links to Wikipedia. They should have previews on them.