Browse Source

standard: spaces in comments

pull/979/head
Vitaly Puzrin 1 year ago
parent
commit
94177fca70
  1. 5
      .eslintrc.yml
  2. 3
      bin/markdown-it.mjs
  3. 6
      lib/common/utils.mjs
  4. 4
      lib/index.mjs
  5. 2
      lib/parser_inline.mjs
  6. 1
      lib/renderer.mjs
  7. 2
      lib/ruler.mjs
  8. 1
      support/demo_template/index.mjs
  9. 4
      support/specsplit.mjs

5
.eslintrc.yml

@ -153,7 +153,10 @@ rules:
space-infix-ops: 2 space-infix-ops: 2
space-unary-ops: 2 space-unary-ops: 2
# Postponed # Postponed
#spaced-comment: [ 1, always, { exceptions: [ '/', '=' ] } ] spaced-comment: [ 2, 'always', {
line: { markers: ['*package', '!', '/', ',', '='] },
block: { balanced: true, markers: ['*package', '!', ',', ':', '::', 'flow-include'], exceptions: ['*'] }
}]
strict: [ 2, global ] strict: [ 2, global ]
quotes: [ 2, single, avoid-escape ] quotes: [ 2, single, avoid-escape ]
quote-props: [ 1, 'as-needed' ] quote-props: [ 1, 'as-needed' ]

3
bin/markdown-it.mjs

@ -5,7 +5,6 @@ import fs from 'node:fs'
import argparse from 'argparse' import argparse from 'argparse'
import markdownit from '../index.mjs' import markdownit from '../index.mjs'
////////////////////////////////////////////////////////////////////////////////
const cli = new argparse.ArgumentParser({ const cli = new argparse.ArgumentParser({
prog: 'markdown-it', prog: 'markdown-it',
@ -67,8 +66,6 @@ function readFile (filename, encoding, callback) {
} }
////////////////////////////////////////////////////////////////////////////////
readFile(options.file, 'utf8', function (err, input) { readFile(options.file, 'utf8', function (err, input) {
let output let output

6
lib/common/utils.mjs

@ -42,7 +42,6 @@ function arrayReplaceAt (src, pos, newElements) {
return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1)) return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1))
} }
////////////////////////////////////////////////////////////////////////////////
function isValidEntityCode (c) { function isValidEntityCode (c) {
/* eslint no-bitwise:0 */ /* eslint no-bitwise:0 */
@ -121,7 +120,6 @@ function unescapeAll (str) {
}) })
} }
////////////////////////////////////////////////////////////////////////////////
const HTML_ESCAPE_TEST_RE = /[&<>"]/ const HTML_ESCAPE_TEST_RE = /[&<>"]/
const HTML_ESCAPE_REPLACE_RE = /[&<>"]/g const HTML_ESCAPE_REPLACE_RE = /[&<>"]/g
@ -143,7 +141,6 @@ function escapeHtml (str) {
return str return str
} }
////////////////////////////////////////////////////////////////////////////////
const REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g const REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g
@ -151,7 +148,6 @@ function escapeRE (str) {
return str.replace(REGEXP_ESCAPE_RE, '\\$&') return str.replace(REGEXP_ESCAPE_RE, '\\$&')
} }
////////////////////////////////////////////////////////////////////////////////
function isSpace (code) { function isSpace (code) {
switch (code) { switch (code) {
@ -182,7 +178,6 @@ function isWhiteSpace (code) {
return false return false
} }
////////////////////////////////////////////////////////////////////////////////
/* eslint-disable max-len */ /* eslint-disable max-len */
@ -291,7 +286,6 @@ function normalizeReference (str) {
return str.toLowerCase().toUpperCase() return str.toLowerCase().toUpperCase()
} }
////////////////////////////////////////////////////////////////////////////////
// Re-export libraries commonly used in both markdown-it and its plugins, // Re-export libraries commonly used in both markdown-it and its plugins,
// so plugins won't have to depend on them explicitly, which reduces their // so plugins won't have to depend on them explicitly, which reduces their

4
lib/index.mjs

@ -20,7 +20,7 @@ const config = {
commonmark: cfg_commonmark commonmark: cfg_commonmark
} }
////////////////////////////////////////////////////////////////////////////////
// //
// This validator can prohibit more than really needed to prevent XSS. It's a // This validator can prohibit more than really needed to prevent XSS. It's a
// tradeoff to keep code simple and to be secure by default. // tradeoff to keep code simple and to be secure by default.
@ -39,8 +39,6 @@ function validateLink (url) {
return BAD_PROTO_RE.test(str) ? (GOOD_DATA_RE.test(str) ? true : false) : true return BAD_PROTO_RE.test(str) ? (GOOD_DATA_RE.test(str) ? true : false) : true
} }
////////////////////////////////////////////////////////////////////////////////
const RECODE_HOSTNAME_FOR = ['http:', 'https:', 'mailto:'] const RECODE_HOSTNAME_FOR = ['http:', 'https:', 'mailto:']

2
lib/parser_inline.mjs

@ -24,8 +24,6 @@ import r_balance_pairs from './rules_inline/balance_pairs.mjs'
import r_fragments_join from './rules_inline/fragments_join.mjs' import r_fragments_join from './rules_inline/fragments_join.mjs'
////////////////////////////////////////////////////////////////////////////////
// Parser rules // Parser rules
const _rules = [ const _rules = [

1
lib/renderer.mjs

@ -8,7 +8,6 @@
import { assign, unescapeAll, escapeHtml } from './common/utils.mjs' import { assign, unescapeAll, escapeHtml } from './common/utils.mjs'
////////////////////////////////////////////////////////////////////////////////
const default_rules = {} const default_rules = {}

2
lib/ruler.mjs

@ -40,7 +40,7 @@ function Ruler () {
this.__cache__ = null this.__cache__ = null
} }
////////////////////////////////////////////////////////////////////////////////
// Helper methods, should not be used directly // Helper methods, should not be used directly

1
support/demo_template/index.mjs

@ -349,7 +349,6 @@ function loadPermalink () {
} }
//////////////////////////////////////////////////////////////////////////////
// Init on page load // Init on page load
// //
$(function () { $(function () {

4
support/specsplit.mjs

@ -31,13 +31,11 @@ cli.add_argument('-o', '--output', {
const options = cli.parse_args() const options = cli.parse_args()
////////////////////////////////////////////////////////////////////////////////
function normalize (text) { function normalize (text) {
return text.replace(/<blockquote>\n<\/blockquote>/g, '<blockquote></blockquote>') return text.replace(/<blockquote>\n<\/blockquote>/g, '<blockquote></blockquote>')
} }
////////////////////////////////////////////////////////////////////////////////
function readFile (filename, encoding, callback) { function readFile (filename, encoding, callback) {
if (options.file === '-') { if (options.file === '-') {
@ -58,8 +56,6 @@ function readFile (filename, encoding, callback) {
} }
////////////////////////////////////////////////////////////////////////////////
readFile(options.spec, 'utf8', function (error, input) { readFile(options.spec, 'utf8', function (error, input) {
const good = [] const good = []
const bad = [] const bad = []

Loading…
Cancel
Save