@github/markdown-toolbar-element
Advanced tools
+26
-1
@@ -51,4 +51,11 @@ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; var ownKeys = Object.keys(source); if (typeof Object.getOwnPropertySymbols === 'function') { ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function (sym) { return Object.getOwnPropertyDescriptor(source, sym).enumerable; })); } ownKeys.forEach(function (key) { _defineProperty(target, key, source[key]); }); } return target; } | ||
| super(); | ||
| const level = parseInt(this.getAttribute('level') || 3, 10); | ||
| if (level < 1 || level > 6) { | ||
| return; | ||
| } | ||
| const prefix = "".concat('#'.repeat(level), " "); | ||
| styles.set(this, { | ||
| prefix: '### ' | ||
| prefix | ||
| }); | ||
@@ -166,2 +173,20 @@ } | ||
| class MarkdownImageButtonElement extends MarkdownButtonElement { | ||
| constructor() { | ||
| super(); | ||
| styles.set(this, { | ||
| prefix: '', | ||
| replaceNext: 'url', | ||
| scanFor: 'https?://' | ||
| }); | ||
| } | ||
| } | ||
| if (!window.customElements.get('md-image')) { | ||
| window.MarkdownImageButtonElement = MarkdownImageButtonElement; | ||
| window.customElements.define('md-image', MarkdownImageButtonElement); | ||
| } | ||
| class MarkdownUnorderedListButtonElement extends MarkdownButtonElement { | ||
@@ -168,0 +193,0 @@ constructor() { |
+26
-1
@@ -71,4 +71,11 @@ (function (global, factory) { | ||
| super(); | ||
| const level = parseInt(this.getAttribute('level') || 3, 10); | ||
| if (level < 1 || level > 6) { | ||
| return; | ||
| } | ||
| const prefix = "".concat('#'.repeat(level), " "); | ||
| styles.set(this, { | ||
| prefix: '### ' | ||
| prefix | ||
| }); | ||
@@ -186,2 +193,20 @@ } | ||
| class MarkdownImageButtonElement extends MarkdownButtonElement { | ||
| constructor() { | ||
| super(); | ||
| styles.set(this, { | ||
| prefix: '', | ||
| replaceNext: 'url', | ||
| scanFor: 'https?://' | ||
| }); | ||
| } | ||
| } | ||
| if (!window.customElements.get('md-image')) { | ||
| window.MarkdownImageButtonElement = MarkdownImageButtonElement; | ||
| window.customElements.define('md-image', MarkdownImageButtonElement); | ||
| } | ||
| class MarkdownUnorderedListButtonElement extends MarkdownButtonElement { | ||
@@ -188,0 +213,0 @@ constructor() { |
+1
-1
| { | ||
| "name": "@github/markdown-toolbar-element", | ||
| "version": "1.0.7", | ||
| "version": "1.1.0", | ||
| "description": "Markdown formatting buttons for text inputs.", | ||
@@ -5,0 +5,0 @@ "repository": "github/markdown-toolbar-element", |
+1
-0
@@ -25,2 +25,3 @@ # <markdown-toolbar> element | ||
| <md-link>link</md-link> | ||
| <md-image>image</md-image> | ||
| <md-unordered-list>unordered-list</md-unordered-list> | ||
@@ -27,0 +28,0 @@ <md-ordered-list>ordered-list</md-ordered-list> |
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
45535
2.8%1190
3.48%57
1.79%0
-100%