mirror of
https://github.com/TryGhost/Ghost.git
synced 2024-11-27 00:52:36 +03:00
90b7a3f4d0
closes https://github.com/TryGhost/Team/issues/2548 Rather than use a setter here we've used a verify method which takes the HTML string and naively validates that the target URL is present. This is so that the logic of verification is encapsulated in the Mention, and should mean that erroneous verification doesn't happen. We could consider down the line that the verify method fetches the content itself, but if we're to do that we should pass in `got` as a param, so that it's possible to stub in tests. One thing to think about when it comes time to making this as performant as possible is doing a single fetch of the source document and using that for verification and metadata extraction. At that point we should probably consolidate both of those operations, either moving the metadata extraction into the Mention entity (passing in any necessary deps) OR we move the verification out to the same layer as metadata extraction. |
||
---|---|---|
.. | ||
lib | ||
test | ||
.eslintrc.js | ||
index.js | ||
package.json | ||
README.md |
Webmentions
Usage
Develop
This is a monorepo package.
Follow the instructions for the top-level repo.
git clone
this repo &cd
into it as usual- Run
yarn
to install top-level dependencies.
Test
yarn lint
run just eslintyarn test
run lint and tests