Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/fourtyone11/origin-hugo-theme.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'assets/node_modules/remark-parse/lib/util/interrupt.js')
-rw-r--r--assets/node_modules/remark-parse/lib/util/interrupt.js35
1 files changed, 35 insertions, 0 deletions
diff --git a/assets/node_modules/remark-parse/lib/util/interrupt.js b/assets/node_modules/remark-parse/lib/util/interrupt.js
new file mode 100644
index 0000000..e707c8b
--- /dev/null
+++ b/assets/node_modules/remark-parse/lib/util/interrupt.js
@@ -0,0 +1,35 @@
+'use strict'
+
+module.exports = interrupt
+
+function interrupt(interruptors, tokenizers, ctx, params) {
+ var length = interruptors.length
+ var index = -1
+ var interruptor
+ var config
+
+ while (++index < length) {
+ interruptor = interruptors[index]
+ config = interruptor[1] || {}
+
+ if (
+ config.pedantic !== undefined &&
+ config.pedantic !== ctx.options.pedantic
+ ) {
+ continue
+ }
+
+ if (
+ config.commonmark !== undefined &&
+ config.commonmark !== ctx.options.commonmark
+ ) {
+ continue
+ }
+
+ if (tokenizers[interruptor[0]].apply(ctx, params)) {
+ return true
+ }
+ }
+
+ return false
+}