Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions dist/markdownShortcuts.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/markdownShortcuts.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/markdownShortcuts.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 9 additions & 2 deletions docs/module/index.bundle.js
Original file line number Diff line number Diff line change
Expand Up @@ -15219,6 +15219,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
// THE SOFTWARE.
//


var _quill = __webpack_require__(0);

var _quill2 = _interopRequireDefault(_quill);
Expand Down Expand Up @@ -15247,9 +15248,11 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol

this.quill = quill;
this.options = options;
this.ignoreElements = options && options.ignore || [];

this.ignoreTags = ['PRE'];
this.matches = [{

var elements = [{
name: 'header',
pattern: /^(#){1,6}\s/g,
action: function action(text, selection, pattern) {
Expand Down Expand Up @@ -15387,7 +15390,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
}, 0);
}
}, {
name: 'asterisk-ul',
name: 'plus-ul',
// Quill 1.3.5 already treat * as another trigger for bullet lists
pattern: /^\+\s$/g,
action: function action(text, selection, pattern) {
Expand Down Expand Up @@ -15430,6 +15433,10 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
}
}];

this.matches = elements.filter(function (element) {
return !_this.ignoreElements.includes(element.name);
});

// Handler that looks for insert deltas that match specific characters
this.quill.on('text-change', function (delta, oldContents, source) {
for (var i = 0; i < delta.ops.length; i++) {
Expand Down
2 changes: 1 addition & 1 deletion docs/module/index.bundle.js.map

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,12 @@ class MarkdownShortcuts {
constructor (quill, options) {
this.quill = quill
this.options = options
this.ignoreElements = (options && options.ignore) || []


this.ignoreTags = ['PRE']
this.matches = [

const elements = [
{
name: 'header',
pattern: /^(#){1,6}\s/g,
Expand Down Expand Up @@ -232,6 +235,8 @@ class MarkdownShortcuts {
}
]

this.matches = elements.filter(element => !this.ignoreElements.includes(element.name))

// Handler that looks for insert deltas that match specific characters
this.quill.on('text-change', (delta, oldContents, source) => {
for (let i = 0; i < delta.ops.length; i++) {
Expand Down