markdown-it-sup
Advanced tools
Comparing version 1.0.0 to 2.0.0
@@ -1,69 +0,60 @@ | ||
/*! markdown-it-sup 1.0.0 https://github.com//markdown-it/markdown-it-sup @license MIT */(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.markdownitSup = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){ | ||
// Process ^superscript^ | ||
'use strict'; | ||
// same as UNESCAPE_MD_RE plus a space | ||
var UNESCAPE_RE = /\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g; | ||
function superscript(state, silent) { | ||
var found, | ||
content, | ||
token, | ||
max = state.posMax, | ||
start = state.pos; | ||
if (state.src.charCodeAt(start) !== 0x5E/* ^ */) { return false; } | ||
if (silent) { return false; } // don't run any pairs in validation mode | ||
if (start + 2 >= max) { return false; } | ||
state.pos = start + 1; | ||
while (state.pos < max) { | ||
if (state.src.charCodeAt(state.pos) === 0x5E/* ^ */) { | ||
found = true; | ||
break; | ||
/*! markdown-it-sup 2.0.0 https://github.com/markdown-it/markdown-it-sup @license MIT */ | ||
(function(global, factory) { | ||
typeof exports === "object" && typeof module !== "undefined" ? module.exports = factory() : typeof define === "function" && define.amd ? define(factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, | ||
global.markdownitSup = factory()); | ||
})(this, (function() { | ||
"use strict"; | ||
// Process ^superscript^ | ||
// same as UNESCAPE_MD_RE plus a space | ||
const UNESCAPE_RE = /\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g; | ||
function superscript(state, silent) { | ||
const max = state.posMax; | ||
const start = state.pos; | ||
if (state.src.charCodeAt(start) !== 94 /* ^ */) { | ||
return false; | ||
} | ||
state.md.inline.skipToken(state); | ||
if (silent) { | ||
return false; | ||
} | ||
// don't run any pairs in validation mode | ||
if (start + 2 >= max) { | ||
return false; | ||
} | ||
state.pos = start + 1; | ||
let found = false; | ||
while (state.pos < max) { | ||
if (state.src.charCodeAt(state.pos) === 94 /* ^ */) { | ||
found = true; | ||
break; | ||
} | ||
state.md.inline.skipToken(state); | ||
} | ||
if (!found || start + 1 === state.pos) { | ||
state.pos = start; | ||
return false; | ||
} | ||
const content = state.src.slice(start + 1, state.pos); | ||
// don't allow unescaped spaces/newlines inside | ||
if (content.match(/(^|[^\\])(\\\\)*\s/)) { | ||
state.pos = start; | ||
return false; | ||
} | ||
// found! | ||
state.posMax = state.pos; | ||
state.pos = start + 1; | ||
// Earlier we checked !silent, but this implementation does not need it | ||
const token_so = state.push("sup_open", "sup", 1); | ||
token_so.markup = "^"; | ||
const token_t = state.push("text", "", 0); | ||
token_t.content = content.replace(UNESCAPE_RE, "$1"); | ||
const token_sc = state.push("sup_close", "sup", -1); | ||
token_sc.markup = "^"; | ||
state.pos = state.posMax + 1; | ||
state.posMax = max; | ||
return true; | ||
} | ||
if (!found || start + 1 === state.pos) { | ||
state.pos = start; | ||
return false; | ||
function sup_plugin(md) { | ||
md.inline.ruler.after("emphasis", "sup", superscript); | ||
} | ||
content = state.src.slice(start + 1, state.pos); | ||
// don't allow unescaped spaces/newlines inside | ||
if (content.match(/(^|[^\\])(\\\\)*\s/)) { | ||
state.pos = start; | ||
return false; | ||
} | ||
// found! | ||
state.posMax = state.pos; | ||
state.pos = start + 1; | ||
// Earlier we checked !silent, but this implementation does not need it | ||
token = state.push('sup_open', 'sup', 1); | ||
token.markup = '^'; | ||
token = state.push('text', '', 0); | ||
token.content = content.replace(UNESCAPE_RE, '$1'); | ||
token = state.push('sup_close', 'sup', -1); | ||
token.markup = '^'; | ||
state.pos = state.posMax + 1; | ||
state.posMax = max; | ||
return true; | ||
} | ||
module.exports = function sup_plugin(md) { | ||
md.inline.ruler.after('emphasis', 'sup', superscript); | ||
}; | ||
},{}]},{},[1])(1) | ||
}); | ||
return sup_plugin; | ||
})); |
@@ -1,2 +0,2 @@ | ||
/*! markdown-it-sup 1.0.0 https://github.com//markdown-it/markdown-it-sup @license MIT */ | ||
!function(e){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=e();else if("function"==typeof define&&define.amd)define([],e);else{var r;r="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this,r.markdownitSup=e()}}(function(){return function e(r,o,n){function t(i,p){if(!o[i]){if(!r[i]){var u="function"==typeof require&&require;if(!p&&u)return u(i,!0);if(s)return s(i,!0);var f=new Error("Cannot find module '"+i+"'");throw f.code="MODULE_NOT_FOUND",f}var a=o[i]={exports:{}};r[i][0].call(a.exports,function(e){var o=r[i][1][e];return t(o?o:e)},a,a.exports,e,r,o,n)}return o[i].exports}for(var s="function"==typeof require&&require,i=0;i<n.length;i++)t(n[i]);return t}({1:[function(e,r){"use strict";function o(e,r){var o,t,s,i=e.posMax,p=e.pos;if(94!==e.src.charCodeAt(p))return!1;if(r)return!1;if(p+2>=i)return!1;for(e.pos=p+1;e.pos<i;){if(94===e.src.charCodeAt(e.pos)){o=!0;break}e.md.inline.skipToken(e)}return o&&p+1!==e.pos?(t=e.src.slice(p+1,e.pos),t.match(/(^|[^\\])(\\\\)*\s/)?(e.pos=p,!1):(e.posMax=e.pos,e.pos=p+1,s=e.push("sup_open","sup",1),s.markup="^",s=e.push("text","",0),s.content=t.replace(n,"$1"),s=e.push("sup_close","sup",-1),s.markup="^",e.pos=e.posMax+1,e.posMax=i,!0)):(e.pos=p,!1)}var n=/\\([ \\!"#$%&'()*+,.\/:;<=>?@[\]^_`{|}~-])/g;r.exports=function(e){e.inline.ruler.after("emphasis","sup",o)}},{}]},{},[1])(1)}); | ||
/*! markdown-it-sup 2.0.0 https://github.com/markdown-it/markdown-it-sup @license MIT */ | ||
!function(e,s){"object"==typeof exports&&"undefined"!=typeof module?module.exports=s():"function"==typeof define&&define.amd?define(s):(e="undefined"!=typeof globalThis?globalThis:e||self).markdownitSup=s()}(this,(function(){"use strict";const e=/\\([ \\!"#$%&'()*+,./:;<=>?@[\]^_`{|}~-])/g;function s(s,o){const n=s.posMax,p=s.pos;if(94!==s.src.charCodeAt(p))return!1;if(o)return!1;if(p+2>=n)return!1;s.pos=p+1;let t=!1;for(;s.pos<n;){if(94===s.src.charCodeAt(s.pos)){t=!0;break}s.md.inline.skipToken(s)}if(!t||p+1===s.pos)return s.pos=p,!1;const r=s.src.slice(p+1,s.pos);if(r.match(/(^|[^\\])(\\\\)*\s/))return s.pos=p,!1;s.posMax=s.pos,s.pos=p+1;s.push("sup_open","sup",1).markup="^";s.push("text","",0).content=r.replace(e,"$1");return s.push("sup_close","sup",-1).markup="^",s.pos=s.posMax+1,s.posMax=n,!0}return function(e){e.inline.ruler.after("emphasis","sup",s)}})); |
{ | ||
"name": "markdown-it-sup", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "<sup> tag for markdown-it markdown parser.", | ||
@@ -12,28 +12,39 @@ "keywords": [ | ||
], | ||
"homepage": "https://github.com/markdown-it/markdown-it-sup", | ||
"repository": { | ||
"type": "git", | ||
"url": "git://github.com/markdown-it/markdown-it-sup.git" | ||
"repository": "markdown-it/markdown-it-sup", | ||
"license": "MIT", | ||
"main": "dist/index.cjs.js", | ||
"module": "index.mjs", | ||
"exports": { | ||
".": { | ||
"require": "./dist/index.cjs.js", | ||
"import": "./index.mjs" | ||
}, | ||
"./*": { | ||
"require": "./*", | ||
"import": "./*" | ||
} | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/markdown-it/markdown-it-sup/issues" | ||
}, | ||
"license": "MIT", | ||
"main": "index.js", | ||
"files": [ | ||
"index.mjs", | ||
"lib/", | ||
"dist/" | ||
], | ||
"scripts": { | ||
"test": "make test" | ||
"lint": "eslint .", | ||
"build": "rollup -c", | ||
"test": "npm run lint && npm run build && c8 --exclude dist --exclude test -r text -r html -r lcov mocha", | ||
"prepublishOnly": "npm run lint && npm run build" | ||
}, | ||
"devDependencies": { | ||
"browserify": "*", | ||
"coveralls": "^2.11.2", | ||
"eslint": "0.10.2", | ||
"eslint-plugin-nodeca": "^1.0.0", | ||
"istanbul": "*", | ||
"lodash": "*", | ||
"markdown-it": "^4.0.0", | ||
"markdown-it-testgen": "~0.1.0", | ||
"mocha": "*", | ||
"request": "*", | ||
"uglify-js": "*" | ||
"@rollup/plugin-babel": "^6.0.4", | ||
"@rollup/plugin-node-resolve": "^15.2.3", | ||
"@rollup/plugin-terser": "^0.4.4", | ||
"c8": "^8.0.1", | ||
"eslint": "^8.55.0", | ||
"eslint-config-standard": "^17.1.0", | ||
"markdown-it": "^13.0.2", | ||
"markdown-it-testgen": "^0.1.6", | ||
"mocha": "^10.2.0", | ||
"rollup": "^4.6.1" | ||
} | ||
} |
# markdown-it-sup | ||
[![Build Status](https://img.shields.io/travis/markdown-it/markdown-it-sup/master.svg?style=flat)](https://travis-ci.org/markdown-it/markdown-it-sup) | ||
[![CI](https://github.com/markdown-it/markdown-it-sup/actions/workflows/ci.yml/badge.svg)](https://github.com/markdown-it/markdown-it-sup/actions/workflows/ci.yml) | ||
[![NPM version](https://img.shields.io/npm/v/markdown-it-sup.svg?style=flat)](https://www.npmjs.org/package/markdown-it-sup) | ||
@@ -5,0 +5,0 @@ [![Coverage Status](https://img.shields.io/coveralls/markdown-it/markdown-it-sup/master.svg?style=flat)](https://coveralls.io/r/markdown-it/markdown-it-sup?branch=master) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
No website
QualityPackage does not have a website.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
9608
10
163
1
7
2
1