bem-md-renderer
Advanced tools
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 |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
68084
397