Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bem-md-renderer

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bem-md-renderer - npm Package Compare versions

Comparing version 0.3.1 to 0.3.2

29

index.js

@@ -144,4 +144,3 @@ var marked = require('marked'),

arr = href.split('/'),
key = arr.pop(),
src;
key = arr.pop();

@@ -158,12 +157,24 @@ /**

/**
* Key contains extra words
* For example:
* Original href = http://www.youtube.com/watch?v=1GWoMnYldYc
* key = watch?v=1GWoMnYldYc - we need remove watch?v=
* Example:
* Original href = http://www.youtube.com/watch?v=1GWoMnYldYc&t=4h30m36s
* key = watch?v=1GWoMnYldYc&t=4h30m36s
*/
if (serviceName === 'youtube' && key.indexOf('watch?v=') > -1) {
key = key.replace('watch?v=', '');
if (serviceName === 'youtube') {
var query = require('querystring').parse(require('url').parse(key).query);
if (query.v) {
key = query.v;
}
if (query.t) {
var hours = +query.t.split('h')[0],
minutes = +query.t.replace(hours + 'h', '').split('m')[0],
seconds = +query.t.replace(hours + 'h' + minutes + 'm', '').replace('s', ''),
timestamp = hours * 60 * 60 + minutes * 60 + seconds;
key += '?start=' + timestamp;
}
}
src = serviceToUrl[serviceName] + key;
var src = serviceToUrl[serviceName] + key;

@@ -170,0 +181,0 @@ return '<iframe src="//' + src + '" width="560" height="315" frameborder="0" allowfullscreen></iframe>';

{
"name": "bem-md-renderer",
"version": "0.3.1",
"version": "0.3.2",
"description": "The builder markdown to html with custom renderer, which generates the html headlines like github",

@@ -5,0 +5,0 @@ "main": "index.js",

@@ -279,6 +279,5 @@ # BEMHTML: шаблонизатор для БЭМ

* [Flatiron.js](http://flatironjs.org/#templating)
* [Angular.js](http://angularjs.org)
* [Pure](http://beebole.com/pure/).
**Live data bind** — отличается тем, что в шаблоне можно декларировать связь не со статическими, а изменяющимися данными. Пример такого шаблонизатора — [Knockout.js](http://knockoutjs.com).
**Live data bind** — отличается тем, что в шаблоне можно декларировать связь не со статическими, а изменяющимися данными. Примеры таких шаблонизаторов — [Angular.js](http://angularjs.org), [Knockout.js](http://knockoutjs.com).

@@ -285,0 +284,0 @@ #### Data driven

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc