breakdance-util
Advanced tools
+9
-9
@@ -126,13 +126,13 @@ 'use strict'; | ||
| exports.getLang = function(attribs) { | ||
| if (typeOf(attribs) === 'object') { | ||
| var lang = get(attribs, 'data-lang') | ||
| || get(attribs, 'data-language') | ||
| || get(attribs, 'class') || ''; | ||
| attribs = attribs || {}; | ||
| var lang = get(attribs, 'data-lang') || get(attribs, 'data-language') || ''; | ||
| var classLang = get(attribs, 'class') || ''; | ||
| var match = /lang(?:uage)?-([^\s]+)/.exec(lang); | ||
| if (match) { | ||
| return match[1]; | ||
| } | ||
| var regex = /lang(?:uage)?-([^\s]+)/; | ||
| var match = regex.exec(lang) || regex.exec(classLang); | ||
| if (match) { | ||
| return match[1]; | ||
| } | ||
| return ''; | ||
| return lang; | ||
| }; | ||
@@ -139,0 +139,0 @@ |
+8
-1
| { | ||
| "name": "breakdance-util", | ||
| "description": "Utility functions for breakdance plugins.", | ||
| "version": "0.1.1", | ||
| "version": "0.1.2", | ||
| "homepage": "https://github.com/jonschlinkert/breakdance-util", | ||
@@ -59,2 +59,9 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)", | ||
| ], | ||
| "related": { | ||
| "list": [ | ||
| "breakdance", | ||
| "generate-breakdance", | ||
| "breakdance-checklist" | ||
| ] | ||
| }, | ||
| "lint": { | ||
@@ -61,0 +68,0 @@ "reflinks": true |
+5
-0
@@ -112,2 +112,7 @@ # breakdance-util [](https://www.npmjs.com/package/breakdance-util) [](https://npmjs.org/package/breakdance-util) [](https://npmjs.org/package/breakdance-util) [](https://travis-ci.org/jonschlinkert/breakdance-util) | ||
| ### Related projects | ||
| * [breakdance-checklist](https://www.npmjs.com/package/breakdance-checklist): Plugin that adds checklist rendering support to breakdance, similar to task lists in github-flavored-markdown. | [homepage](https://github.com/jonschlinkert/breakdance-checklist "Plugin that adds checklist rendering support to breakdance, similar to task lists in github-flavored-markdown.") | ||
| * [breakdance](https://www.npmjs.com/package/breakdance): Breakdance is a node.js library for converting HTML to markdown. Highly pluggable, flexible and easy… [more](http://breakdance.io) | [homepage](http://breakdance.io "Breakdance is a node.js library for converting HTML to markdown. Highly pluggable, flexible and easy to use. It's time for your markup to get down.") | ||
| ### Contributing | ||
@@ -114,0 +119,0 @@ |
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
16296
6.09%155
3.33%283
-0.35%