GithubHelp home page GithubHelp logo

vitaliy-bobrov / metalsmith-twitter-card Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 0.0 28 KB

Twitter card meta tags for Metalsmith

License: MIT License

JavaScript 100.00%
metalsmith metalsmith-plugin twitter-card

metalsmith-twitter-card's People

Contributors

vitaliy-bobrov avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

metalsmith-twitter-card's Issues

High Dependency Vulnerability: cheerio

From npm audit:

┌───────────────┬──────────────────────────────────────────────────────────────┐
│ High          │ Prototype Pollution                                          │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Package       │ lodash.merge                                                 │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Dependency of │ metalsmith-twitter-card                                      │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ Path          │ metalsmith-twitter-card > cheerio > lodash.merge             │
├───────────────┼──────────────────────────────────────────────────────────────┤
│ More info     │ https://npmjs.com/advisories/1066                            │
└───────────────┴──────────────────────────────────────────────────────────────┘

cheerio/htmlparser2 decodeEntities:false Mangles HTML Attribute Values

Issue broken out from my follow-up comments in #1.


The cheerio upgrade in v1.0.5 combined with decodeEntities: false causes HTML such as:

<img src="static/img/blog/what-is-the-jamstack.png" alt="What is the &quot;JAMstack&quot;?" class="w-100 og-image">

to be mangled to:

<img src="static/img/blog/what-is-the-jamstack.png" alt="What is the " jamstack"?" class="w-100 og-image">

isSelector is Overly Aggressive

isSelector() as defined here:

const isSelector = value => value[0] === '.' || value[0] === '#';

Incorrectly returns true for titles or descriptions such as ...lorem ipsum that start with an ellipsis. It also doesn't allow for tag names to come first in the selector.

Maybe a better way would be to check el to see if it found any results here:

let el = $cheerio(value);

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.