Merge branch 'master' of https://github.com/showdownjs/showdown into base-url

This commit is contained in:
SyntaxRules 2021-11-09 23:49:48 -07:00
commit ae1d5db9e0
11 changed files with 8232 additions and 2614 deletions

View File

@ -3,6 +3,7 @@ Credits
- Showdown v2
* [Estevão Santos](https://github.com/tivie)
* [SyntaxRules](https://github.com/SyntaxRules)
- Showdown v1
* [Estevão Santos](https://github.com/tivie)

View File

@ -76,7 +76,7 @@ module.exports = function (grunt) {
eslint: {
options: {
config: '.eslintrc.json'
overrideConfigFile: '.eslintrc.json'
},
target: [
'Gruntfile.js',

20
LICENSE
View File

@ -1,21 +1,9 @@
MIT License
Copyright (c) 2018 ShowdownJS
Copyright (c) 2018,2021 ShowdownJS
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

10747
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,7 @@
"url": "https://github.com/showdownjs/showdown.git",
"web": "https://github.com/showdownjs/showdown"
},
"license": "BSD-3-Clause",
"license": "MIT",
"main": "./dist/showdown.js",
"scripts": {
"test": "grunt test"
@ -43,27 +43,27 @@
"dist"
],
"devDependencies": {
"chai": "4.1.x",
"grunt": "^1.0.3",
"grunt-contrib-clean": "1.1.x",
"grunt-contrib-concat": "1.0.x",
"grunt-contrib-jshint": "1.1.x",
"grunt-contrib-uglify": "~3.3.0",
"grunt-conventional-changelog": "6.1.x",
"grunt-conventional-github-releaser": "1.0.x",
"grunt-endline": "0.6.x",
"grunt-eslint": "19.0.x",
"grunt-simple-mocha": "0.4.x",
"load-grunt-tasks": "3.5.x",
"performance-now": "2.0.x",
"quiet-grunt": "0.2.x",
"semver": "5.4.x",
"semver-sort": "0.0.x",
"sinon": "^5.1.1",
"source-map-support": "^0.5.9"
"chai": "^4.3.4",
"grunt": "^1.4.1",
"grunt-contrib-clean": "^2.0.0",
"grunt-contrib-concat": "^2.0.0",
"grunt-contrib-jshint": "^3.1.0",
"grunt-contrib-uglify": "^5.0.1",
"grunt-conventional-changelog": "^6.1.0",
"grunt-conventional-github-releaser": "^1.0.0",
"grunt-endline": "^0.7.0",
"grunt-eslint": "^24.0.0",
"grunt-simple-mocha": "^0.4.0",
"load-grunt-tasks": "^5.1.0",
"performance-now": "^2.1.0",
"quiet-grunt": "^0.2.0",
"semver": "^7.3.0",
"semver-sort": "^0.0.4",
"sinon": "^12.0.1",
"source-map-support": "^0.5.20"
},
"dependencies": {
"jsdom": "^11.0.0",
"yargs": "14.2.0"
"jsdom": "^18.0.1",
"yargs": "^17.2.1"
}
}

View File

@ -45,10 +45,10 @@ showdown.Converter = function (converterOptions) {
*/
setConvFlavor = setFlavor,
/**
* Metadata of the document
* @type {{parsed: {}, raw: string, format: string}}
*/
/**
* Metadata of the document
* @type {{parsed: {}, raw: string, format: string}}
*/
metadata = {
parsed: {},
raw: '',
@ -107,7 +107,7 @@ showdown.Converter = function (converterOptions) {
'Please inform the developer that the extension should be updated!');
legacyExtensionLoading(showdown.extensions[ext], ext);
return;
// END LEGACY SUPPORT CODE
// END LEGACY SUPPORT CODE
} else if (!showdown.helper.isUndefined(extensions[ext])) {
ext = extensions[ext];

View File

@ -504,8 +504,8 @@ showdown.helper.Event = function (name, text, params) {
/**
* POLYFILLS
*/
// use this instead if builtin is undefined for IE8 compatibility
if (typeof(console) === 'undefined') {
// use this instead of builtin is undefined for IE8 compatibility
if (typeof (console) === 'undefined') {
console = {
warn: function (msg) {
'use strict';

View File

@ -28,7 +28,7 @@ showdown.subParser('makehtml.codeSpans', function (text, options, globals) {
text = globals.converter._dispatch('makehtml.codeSpans.before', text, options, globals).getText();
if (typeof(text) === 'undefined') {
if (typeof (text) === 'undefined') {
text = '';
}
text = text.replace(/(^|[^\\])(`+)([^\r]*?[^`])\2(?!`)/gm,

View File

@ -70,7 +70,7 @@ showdown.subParser('makehtml.hashHTMLBlocks', function (text, options, globals)
//2. Split the text in that position
var subTexts = showdown.helper.splitAtIndex(text, opTagPos),
//3. Match recursively
//3. Match recursively
newSubText1 = showdown.helper.replaceRecursiveRegExp(subTexts[1], repFunc, patLeft, patRight, 'im');
// prevent an infinite loop

View File

@ -5,13 +5,13 @@ showdown.subParser('makehtml.headers', function (text, options, globals) {
var headerLevelStart = (isNaN(parseInt(options.headerLevelStart))) ? 1 : parseInt(options.headerLevelStart),
// Set text-style headers:
// Header 1
// ========
//
// Header 2
// --------
//
// Set text-style headers:
// Header 1
// ========
//
// Header 2
// --------
//
setextRegexH1 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n={2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n=+[ \t]*\n+/gm,
setextRegexH2 = (options.smoothLivePreview) ? /^(.+)[ \t]*\n-{2,}[ \t]*\n+/gm : /^(.+)[ \t]*\n-+[ \t]*\n+/gm;

View File

@ -6,7 +6,7 @@ showdown.subParser('makehtml.tables', function (text, options, globals) {
}
var tableRgx = /^ {0,3}\|?.+\|.+\n {0,3}\|?[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*:?[ \t]*(?:[-=]){2,}[\s\S]+?(?:\n\n|¨0)/gm,
//singeColTblRgx = /^ {0,3}\|.+\|\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n(?: {0,3}\|.+\|\n)+(?:\n\n|¨0)/gm;
//singeColTblRgx = /^ {0,3}\|.+\|\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n(?: {0,3}\|.+\|\n)+(?:\n\n|¨0)/gm;
singeColTblRgx = /^ {0,3}\|.+\|[ \t]*\n {0,3}\|[ \t]*:?[ \t]*(?:[-=]){2,}[ \t]*:?[ \t]*\|[ \t]*\n( {0,3}\|.+\|[ \t]*\n)*(?:\n|¨0)/gm;
function parseStyles (sLine) {