marked-underline 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/.editorconfig ADDED
@@ -0,0 +1,16 @@
1
+ root = true
2
+
3
+ [*.{json,js}]
4
+ charset = utf-8
5
+ end_of_line = lf
6
+ insert_final_newline = true
7
+ indent_style = space
8
+ indent_size = 2
9
+
10
+ [*.md]
11
+ charset = utf-8
12
+ end_of_line = lf
13
+ insert_final_newline = true
14
+ trim_trailing_whitespace = true
15
+ indent_style = tab
16
+ indent_size = 4
package/.eslintignore ADDED
@@ -0,0 +1,2 @@
1
+ lib
2
+ *.min.js
package/.eslintrc.json ADDED
@@ -0,0 +1,26 @@
1
+ {
2
+ "extends": "standard",
3
+ "rules": {
4
+ "semi": ["error", "always"],
5
+ "indent": ["error", 2, {
6
+ "SwitchCase": 1,
7
+ "VariableDeclarator": { "var": 2 },
8
+ "outerIIFEBody": 0
9
+ }],
10
+ "operator-linebreak": ["error", "before", { "overrides": { "=": "after" } }],
11
+ "space-before-function-paren": ["error", "never"],
12
+ "no-cond-assign": "off",
13
+ "no-useless-escape": "off",
14
+ "one-var": "off",
15
+ "no-control-regex": "off",
16
+ "no-prototype-builtins": "off",
17
+ "no-extra-semi": "error",
18
+
19
+ "prefer-const": "error",
20
+ "no-var": "error"
21
+ },
22
+ "env": {
23
+ "node": true,
24
+ "jest": true
25
+ }
26
+ }
@@ -0,0 +1,12 @@
1
+ version: 2
2
+ updates:
3
+ - package-ecosystem: "github-actions"
4
+ directory: "/"
5
+ schedule:
6
+ interval: "weekly"
7
+ - package-ecosystem: "npm"
8
+ versioning-strategy: "increase"
9
+ directory: "/"
10
+ schedule:
11
+ interval: "weekly"
12
+ open-pull-requests-limit: 20
@@ -0,0 +1,39 @@
1
+ name: "Automerge"
2
+ on:
3
+ workflow_run:
4
+ workflows:
5
+ - CI
6
+ types:
7
+ - completed
8
+
9
+ jobs:
10
+ Automerge:
11
+ runs-on: ubuntu-latest
12
+ if: |
13
+ github.event.workflow_run.event == 'pull_request' &&
14
+ github.event.workflow_run.conclusion == 'success'
15
+ steps:
16
+ - name: 'Merge PR'
17
+ uses: actions/github-script@v7
18
+ with:
19
+ github-token: ${{ secrets.GITHUB_TOKEN }}
20
+ script: |
21
+ const pr = await github.rest.pulls.get({
22
+ owner: context.repo.owner,
23
+ repo: context.repo.repo,
24
+ pull_number: context.payload.workflow_run.pull_requests[0].number,
25
+ });
26
+ if (!pr.data.title.startsWith('chore(deps-dev):')) {
27
+ console.log('Not Merged 🚫');
28
+ console.log(`Title '${pr.data.title}' does not start with 'chore(deps-dev):'`);
29
+ } else if (pr.data.user.login !== 'dependabot[bot]') {
30
+ console.log('Not Merged 🚫');
31
+ console.log(`User '${pr.data.user.login}' does not equal 'dependabot[bot]'`);
32
+ } else {
33
+ await github.rest.pulls.merge({
34
+ owner: context.repo.owner,
35
+ repo: context.repo.repo,
36
+ pull_number: context.payload.workflow_run.pull_requests[0].number,
37
+ });
38
+ console.log('Merged 🎉');
39
+ }
@@ -0,0 +1,78 @@
1
+ name: "CI"
2
+ on:
3
+ pull_request:
4
+ push:
5
+ branches:
6
+ - main
7
+
8
+ jobs:
9
+
10
+ Test:
11
+ if: "!contains(github.event.head_commit.message, '[skip ci]')"
12
+ runs-on: ubuntu-latest
13
+ steps:
14
+ - name: Checkout Code
15
+ uses: actions/checkout@v4
16
+ - name: Install Node
17
+ uses: dcodeIO/setup-node-nvm@master
18
+ with:
19
+ node-version: 'lts/*'
20
+ - name: Install Dependencies
21
+ run: npm ci
22
+ - name: Run Tests 👩🏽‍💻
23
+ run: npm run test
24
+
25
+ Coverage:
26
+ if: "!contains(github.event.head_commit.message, '[skip ci]')"
27
+ runs-on: ubuntu-latest
28
+ steps:
29
+ - name: Checkout Code
30
+ uses: actions/checkout@v4
31
+ - name: Install Node
32
+ uses: dcodeIO/setup-node-nvm@master
33
+ with:
34
+ node-version: 'lts/*'
35
+ - name: Install Dependencies
36
+ run: npm ci
37
+ - name: Run Tests 👩🏽‍💻
38
+ run: npm run test:cover
39
+
40
+ Lint:
41
+ if: "!contains(github.event.head_commit.message, '[skip ci]')"
42
+ runs-on: ubuntu-latest
43
+ steps:
44
+ - name: Checkout Code
45
+ uses: actions/checkout@v4
46
+ - name: Install Dependencies
47
+ run: npm ci
48
+ - name: Lint ✨
49
+ run: npm run lint
50
+
51
+ Release:
52
+ needs: [Test, Lint]
53
+ if: |
54
+ github.ref == 'refs/heads/main' &&
55
+ github.event.repository.fork == false
56
+ runs-on: ubuntu-latest
57
+ steps:
58
+ - name: Checkout Code
59
+ uses: actions/checkout@v4
60
+ - name: Install Node
61
+ uses: dcodeIO/setup-node-nvm@master
62
+ with:
63
+ node-version: 'lts/*'
64
+ - name: Install Dependencies
65
+ run: npm ci
66
+ - name: Build 🗜️
67
+ run: |
68
+ npm run build
69
+ if ! git diff --quiet; then
70
+ git config --global user.email "<>"
71
+ git config --global user.name "CI Build"
72
+ git commit -am "🗜️ build [skip ci]"
73
+ fi
74
+ - name: Release 🎉
75
+ env:
76
+ GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
77
+ NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
78
+ run: npx semantic-release
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2021 @markedjs
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,17 @@
1
+ # marked-underline
2
+
3
+ Add underline markup to Markdown by repurposing `_Text_`.
4
+
5
+ # Usage
6
+ <!-- Show most examples of how to use this extension -->
7
+
8
+ ```js
9
+ const marked = require("marked");
10
+ const markedSubSuper = require("marked-underline");
11
+
12
+ marked.use(markedSubSuper());
13
+
14
+ const html = marked.parse("This is _underlined_.");
15
+ console.log(html);
16
+ // <p>This is <u>underlined</u>.</p>
17
+ ```
@@ -0,0 +1,3 @@
1
+ {
2
+ "presets": ["@babel/preset-env"]
3
+ }
package/jest.config.js ADDED
@@ -0,0 +1,21 @@
1
+ export default {
2
+ restoreMocks: true,
3
+ clearMocks: true,
4
+ // collectCoverage: true,
5
+ collectCoverageFrom: [
6
+ 'src/index.js'
7
+ ],
8
+ coverageDirectory: 'coverage',
9
+ coverageThreshold: {
10
+ global: {
11
+ branches: 0,
12
+ functions: 0,
13
+ lines: 0,
14
+ statements: 0
15
+ }
16
+ },
17
+ testRegex: /\.test\.js$/.source,
18
+ transform: {
19
+ '\\.[jt]sx?$': 'babel-jest'
20
+ }
21
+ };
package/lib/index.cjs ADDED
@@ -0,0 +1,29 @@
1
+ 'use strict';
2
+
3
+ function index() {
4
+ return {
5
+ extensions: [
6
+ {
7
+ name : 'underline',
8
+ level : 'inline',
9
+ start(src) { return src.match(/\b_([^_]*?)_\b/m)?.index;},
10
+ tokenizer(src, tokens) {
11
+ const regex = /^\b_([^_]*?)_\b/m;
12
+ const match = regex.exec(src);
13
+ if(match?.length) {
14
+ return {
15
+ type : 'underline',
16
+ raw : match[0],
17
+ tokens : this.lexer.inlineTokens(match[1])
18
+ };
19
+ }
20
+ },
21
+ renderer(token) {
22
+ return `<u>${this.parser.parseInline(token.tokens)}</u>`;
23
+ }
24
+ }
25
+ ]
26
+ };
27
+ }
28
+
29
+ module.exports = index;
@@ -0,0 +1,35 @@
1
+ (function (global, factory) {
2
+ typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
3
+ typeof define === 'function' && define.amd ? define(factory) :
4
+ (global = typeof globalThis !== 'undefined' ? globalThis : global || self, global["subsuper-text"] = factory());
5
+ })(this, (function () { 'use strict';
6
+
7
+ function index() {
8
+ return {
9
+ extensions: [
10
+ {
11
+ name : 'underline',
12
+ level : 'inline',
13
+ start(src) { return src.match(/\b_([^_]*?)_\b/m)?.index;},
14
+ tokenizer(src, tokens) {
15
+ const regex = /^\b_([^_]*?)_\b/m;
16
+ const match = regex.exec(src);
17
+ if(match?.length) {
18
+ return {
19
+ type : 'underline',
20
+ raw : match[0],
21
+ tokens : this.lexer.inlineTokens(match[1])
22
+ };
23
+ }
24
+ },
25
+ renderer(token) {
26
+ return `<u>${this.parser.parseInline(token.tokens)}</u>`;
27
+ }
28
+ }
29
+ ]
30
+ };
31
+ }
32
+
33
+ return index;
34
+
35
+ }));
package/package.json ADDED
@@ -0,0 +1,540 @@
1
+ {
2
+ "name": "marked-underline",
3
+ "version": "1.0.0",
4
+ "description": "Underline markup for Marked.js",
5
+ "main": "./lib/index.cjs",
6
+ "module": "./src/index.js",
7
+ "browser": "./lib/index.umd.js",
8
+ "type": "module",
9
+ "keywords": [
10
+ "marked",
11
+ "extension",
12
+ "superscript",
13
+ "subscript"
14
+ ],
15
+ "scripts": {
16
+ "test": "jest --verbose",
17
+ "test:cover": "jest --coverage",
18
+ "test:marked": "node --test --test-reporter=dot spec/marked.spec.js",
19
+ "lint": "eslint --fix .",
20
+ "lint:dry": "eslint .",
21
+ "build": "rollup -c rollup.config.umd.js"
22
+ },
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/dbolack-ab/underline.git"
26
+ },
27
+ "author": "David Bolack <abquintic@gmail.com>",
28
+ "license": "MIT",
29
+ "bugs": {
30
+ "url": "https://github.com/dbolack-ab/underline/issues"
31
+ },
32
+ "homepage": "https://github.com/dbolack-ab/underline#readme",
33
+ "peerDependencies": {
34
+ "marked": ">=3 <16"
35
+ },
36
+ "devDependencies": {
37
+ "@babel/core": "^7.26.0",
38
+ "@babel/preset-env": "^7.26.0",
39
+ "@rollup/plugin-commonjs": "^28.0.2",
40
+ "@rollup/plugin-node-resolve": "^16.0.0",
41
+ "@markedjs/testutils": "^15.0.0-0",
42
+ "@semantic-release/changelog": "^6.0.3",
43
+ "@semantic-release/commit-analyzer": "^13.0.0",
44
+ "@semantic-release/git": "^10.0.1",
45
+ "@semantic-release/github": "^11.0.1",
46
+ "@semantic-release/npm": "^12.0.1",
47
+ "@semantic-release/release-notes-generator": "^14.0.2",
48
+ "babel-jest": "^29.5.0",
49
+ "eslint": "^8.57.1",
50
+ "eslint-config-standard": "^17.1.0",
51
+ "eslint-plugin-import": "^2.31.0",
52
+ "eslint-plugin-node": "^11.1.0",
53
+ "eslint-plugin-promise": "^6.6.0",
54
+ "jest-cli": "^29.7.0",
55
+ "marked": ">=16.2 <18",
56
+ "rollup": "^4.29.2",
57
+ "semantic-release": "^24.2.0"
58
+ },
59
+ "directories": {
60
+ "lib": "lib"
61
+ },
62
+ "dependencies": {
63
+ "acorn": "^8.11.2",
64
+ "acorn-jsx": "^5.3.2",
65
+ "agent-base": "^7.1.0",
66
+ "aggregate-error": "^3.1.0",
67
+ "ajv": "^6.12.6",
68
+ "ansi-escapes": "^4.3.2",
69
+ "ansi-regex": "^5.0.1",
70
+ "ansi-styles": "^4.3.0",
71
+ "any-promise": "^1.3.0",
72
+ "anymatch": "^3.1.3",
73
+ "argparse": "^1.0.10",
74
+ "argv-formatter": "^1.0.0",
75
+ "array-buffer-byte-length": "^1.0.2",
76
+ "array-ify": "^1.0.0",
77
+ "array-includes": "^3.1.8",
78
+ "array.prototype.findlastindex": "^1.2.5",
79
+ "array.prototype.flat": "^1.3.2",
80
+ "array.prototype.flatmap": "^1.3.2",
81
+ "arraybuffer.prototype.slice": "^1.0.4",
82
+ "available-typed-arrays": "^1.0.7",
83
+ "babel-plugin-istanbul": "^6.1.1",
84
+ "babel-plugin-jest-hoist": "^29.6.3",
85
+ "babel-plugin-polyfill-corejs2": "^0.4.11",
86
+ "babel-plugin-polyfill-corejs3": "^0.10.6",
87
+ "babel-plugin-polyfill-regenerator": "^0.6.2",
88
+ "babel-preset-current-node-syntax": "^1.0.1",
89
+ "babel-preset-jest": "^29.6.3",
90
+ "balanced-match": "^1.0.2",
91
+ "before-after-hook": "^3.0.2",
92
+ "bottleneck": "^2.19.5",
93
+ "brace-expansion": "^1.1.11",
94
+ "braces": "^3.0.2",
95
+ "browserslist": "^4.24.3",
96
+ "bser": "^2.1.1",
97
+ "buffer-from": "^1.1.2",
98
+ "builtins": "^5.0.1",
99
+ "call-bind": "^1.0.8",
100
+ "call-bind-apply-helpers": "^1.0.1",
101
+ "call-bound": "^1.0.3",
102
+ "callsites": "^3.1.0",
103
+ "camelcase": "^5.3.1",
104
+ "caniuse-lite": "^1.0.30001690",
105
+ "chalk": "^4.1.2",
106
+ "char-regex": "^1.0.2",
107
+ "ci-info": "^3.3.0",
108
+ "cjs-module-lexer": "^1.2.3",
109
+ "clean-stack": "^2.2.0",
110
+ "cli-highlight": "^2.1.11",
111
+ "cli-table3": "^0.6.5",
112
+ "cliui": "^8.0.1",
113
+ "co": "^4.6.0",
114
+ "coa": "^2.0.2",
115
+ "collect-v8-coverage": "^1.0.2",
116
+ "color-convert": "^2.0.1",
117
+ "color-name": "^1.1.4",
118
+ "commondir": "^1.0.1",
119
+ "compare-func": "^2.0.0",
120
+ "concat-map": "^0.0.1",
121
+ "config-chain": "^1.1.13",
122
+ "conventional-changelog-angular": "^8.0.0",
123
+ "conventional-changelog-writer": "^8.0.0",
124
+ "conventional-commits-filter": "^5.0.0",
125
+ "conventional-commits-parser": "^6.0.0",
126
+ "convert-hrtime": "^5.0.0",
127
+ "convert-source-map": "^1.8.0",
128
+ "core-js-compat": "^3.38.1",
129
+ "core-util-is": "^1.0.3",
130
+ "cosmiconfig": "^9.0.0",
131
+ "create-jest": "^29.7.0",
132
+ "cross-spawn": "^7.0.3",
133
+ "crypto-random-string": "^4.0.0",
134
+ "data-view-buffer": "^1.0.2",
135
+ "data-view-byte-length": "^1.0.2",
136
+ "data-view-byte-offset": "^1.0.1",
137
+ "debug": "^4.3.4",
138
+ "dedent": "^1.5.1",
139
+ "deep-extend": "^0.6.0",
140
+ "deep-is": "^0.1.4",
141
+ "deepmerge": "^4.2.2",
142
+ "define-data-property": "^1.1.4",
143
+ "define-properties": "^1.2.1",
144
+ "detect-newline": "^3.1.0",
145
+ "diff": "^6.0.0",
146
+ "diff-sequences": "^29.6.3",
147
+ "dir-glob": "^3.0.1",
148
+ "doctrine": "^3.0.0",
149
+ "dot-prop": "^5.3.0",
150
+ "dunder-proto": "^1.0.1",
151
+ "duplexer2": "^0.1.4",
152
+ "electron-to-chromium": "^1.5.76",
153
+ "emittery": "^0.13.1",
154
+ "emoji-regex": "^8.0.0",
155
+ "emojilib": "^2.4.0",
156
+ "entities": "^4.5.0",
157
+ "env-ci": "^11.0.0",
158
+ "env-paths": "^2.2.1",
159
+ "environment": "^1.1.0",
160
+ "error-ex": "^1.3.2",
161
+ "es-abstract": "^1.23.9",
162
+ "es-define-property": "^1.0.1",
163
+ "es-errors": "^1.3.0",
164
+ "es-object-atoms": "^1.0.0",
165
+ "es-set-tostringtag": "^2.1.0",
166
+ "es-shim-unscopables": "^1.0.2",
167
+ "es-to-primitive": "^1.3.0",
168
+ "escalade": "^3.2.0",
169
+ "escape-string-regexp": "^4.0.0",
170
+ "eslint-import-resolver-node": "^0.3.9",
171
+ "eslint-module-utils": "^2.12.0",
172
+ "eslint-plugin-es": "^4.1.0",
173
+ "eslint-plugin-n": "^15.2.2",
174
+ "eslint-scope": "^7.2.2",
175
+ "eslint-utils": "^2.1.0",
176
+ "eslint-visitor-keys": "^3.4.3",
177
+ "espree": "^9.6.1",
178
+ "esprima": "^4.0.1",
179
+ "esquery": "^1.4.2",
180
+ "esrecurse": "^4.3.0",
181
+ "estraverse": "^5.3.0",
182
+ "estree-walker": "^2.0.2",
183
+ "esutils": "^2.0.3",
184
+ "execa": "^5.1.1",
185
+ "exit": "^0.1.2",
186
+ "expect": "^29.7.0",
187
+ "fast-deep-equal": "^3.1.3",
188
+ "fast-glob": "^3.3.2",
189
+ "fast-json-stable-stringify": "^2.1.0",
190
+ "fast-levenshtein": "^2.0.6",
191
+ "fastq": "^1.13.0",
192
+ "fb-watchman": "^2.0.2",
193
+ "figures": "^6.1.0",
194
+ "file-entry-cache": "^6.0.1",
195
+ "fill-range": "^7.0.1",
196
+ "find-up": "^2.1.0",
197
+ "find-up-simple": "^1.0.0",
198
+ "find-versions": "^6.0.0",
199
+ "flat-cache": "^3.0.4",
200
+ "flatted": "^3.2.4",
201
+ "for-each": "^0.3.3",
202
+ "from2": "^2.3.0",
203
+ "front-matter": "^4.0.2",
204
+ "fs-extra": "^11.1.0",
205
+ "fs.realpath": "^1.0.0",
206
+ "function-bind": "^1.1.2",
207
+ "function-timeout": "^1.0.2",
208
+ "function.prototype.name": "^1.1.8",
209
+ "functions-have-names": "^1.2.3",
210
+ "gensync": "^1.0.0-beta.2",
211
+ "get-caller-file": "^2.0.5",
212
+ "get-intrinsic": "^1.2.7",
213
+ "get-package-type": "^0.1.0",
214
+ "get-proto": "^1.0.1",
215
+ "get-stream": "^6.0.1",
216
+ "get-symbol-description": "^1.1.0",
217
+ "git-log-parser": "^1.2.0",
218
+ "glob": "^7.2.0",
219
+ "glob-parent": "^5.1.2",
220
+ "globals": "^13.23.0",
221
+ "globalthis": "^1.0.4",
222
+ "globby": "^14.0.0",
223
+ "gopd": "^1.2.0",
224
+ "graceful-fs": "^4.2.10",
225
+ "graphemer": "^1.4.0",
226
+ "handlebars": "^4.7.8",
227
+ "has-bigints": "^1.1.0",
228
+ "has-flag": "^4.0.0",
229
+ "has-property-descriptors": "^1.0.2",
230
+ "has-proto": "^1.2.0",
231
+ "has-symbols": "^1.1.0",
232
+ "has-tostringtag": "^1.0.2",
233
+ "hasown": "^2.0.2",
234
+ "highlight.js": "^10.7.3",
235
+ "hook-std": "^3.0.0",
236
+ "hosted-git-info": "^7.0.2",
237
+ "html-escaper": "^2.0.2",
238
+ "http-proxy-agent": "^7.0.0",
239
+ "https-proxy-agent": "^7.0.0",
240
+ "human-signals": "^2.1.0",
241
+ "ignore": "^5.3.0",
242
+ "import-fresh": "^3.3.0",
243
+ "import-from-esm": "^2.0.0",
244
+ "import-local": "^3.0.3",
245
+ "import-meta-resolve": "^4.1.0",
246
+ "imurmurhash": "^0.1.4",
247
+ "indent-string": "^4.0.0",
248
+ "index-to-position": "^0.1.2",
249
+ "inflight": "^1.0.6",
250
+ "inherits": "^2.0.4",
251
+ "ini": "^1.3.8",
252
+ "internal-slot": "^1.1.0",
253
+ "into-stream": "^7.0.0",
254
+ "is-array-buffer": "^3.0.5",
255
+ "is-arrayish": "^0.2.1",
256
+ "is-async-function": "^2.1.0",
257
+ "is-bigint": "^1.1.0",
258
+ "is-boolean-object": "^1.2.1",
259
+ "is-callable": "^1.2.7",
260
+ "is-core-module": "^2.16.1",
261
+ "is-data-view": "^1.0.2",
262
+ "is-date-object": "^1.1.0",
263
+ "is-extglob": "^2.1.1",
264
+ "is-finalizationregistry": "^1.1.1",
265
+ "is-fullwidth-code-point": "^3.0.0",
266
+ "is-generator-fn": "^2.1.0",
267
+ "is-generator-function": "^1.1.0",
268
+ "is-glob": "^4.0.3",
269
+ "is-map": "^2.0.3",
270
+ "is-module": "^1.0.0",
271
+ "is-number": "^7.0.0",
272
+ "is-number-object": "^1.1.1",
273
+ "is-obj": "^2.0.0",
274
+ "is-path-inside": "^3.0.3",
275
+ "is-plain-obj": "^4.1.0",
276
+ "is-reference": "^1.2.1",
277
+ "is-regex": "^1.2.1",
278
+ "is-set": "^2.0.3",
279
+ "is-shared-array-buffer": "^1.0.4",
280
+ "is-stream": "^2.0.1",
281
+ "is-string": "^1.1.1",
282
+ "is-symbol": "^1.1.1",
283
+ "is-typed-array": "^1.1.15",
284
+ "is-unicode-supported": "^2.0.0",
285
+ "is-weakmap": "^2.0.2",
286
+ "is-weakref": "^1.1.0",
287
+ "is-weakset": "^2.0.4",
288
+ "isarray": "^1.0.0",
289
+ "isexe": "^2.0.0",
290
+ "issue-parser": "^7.0.1",
291
+ "istanbul-lib-coverage": "^3.2.0",
292
+ "istanbul-lib-instrument": "^5.1.0",
293
+ "istanbul-lib-report": "^3.0.1",
294
+ "istanbul-lib-source-maps": "^4.0.1",
295
+ "istanbul-reports": "^3.1.6",
296
+ "java-properties": "^1.0.2",
297
+ "jest-changed-files": "^29.7.0",
298
+ "jest-circus": "^29.7.0",
299
+ "jest-config": "^29.7.0",
300
+ "jest-diff": "^29.7.0",
301
+ "jest-docblock": "^29.7.0",
302
+ "jest-each": "^29.7.0",
303
+ "jest-environment-node": "^29.7.0",
304
+ "jest-get-type": "^29.6.3",
305
+ "jest-haste-map": "^29.7.0",
306
+ "jest-leak-detector": "^29.7.0",
307
+ "jest-matcher-utils": "^29.7.0",
308
+ "jest-message-util": "^29.7.0",
309
+ "jest-mock": "^29.7.0",
310
+ "jest-pnp-resolver": "^1.2.3",
311
+ "jest-regex-util": "^29.6.3",
312
+ "jest-resolve": "^29.7.0",
313
+ "jest-resolve-dependencies": "^29.7.0",
314
+ "jest-runner": "^29.7.0",
315
+ "jest-runtime": "^29.7.0",
316
+ "jest-snapshot": "^29.7.0",
317
+ "jest-util": "^29.7.0",
318
+ "jest-validate": "^29.7.0",
319
+ "jest-watcher": "^29.7.0",
320
+ "jest-worker": "^29.7.0",
321
+ "js-tokens": "^4.0.0",
322
+ "js-yaml": "^3.14.1",
323
+ "jsesc": "^3.1.0",
324
+ "json-parse-better-errors": "^1.0.2",
325
+ "json-parse-even-better-errors": "^2.3.1",
326
+ "json-schema-traverse": "^0.4.1",
327
+ "json-stable-stringify-without-jsonify": "^1.0.1",
328
+ "json5": "^2.2.3",
329
+ "jsonfile": "^6.1.0",
330
+ "kleur": "^3.0.3",
331
+ "leven": "^3.1.0",
332
+ "levn": "^0.4.1",
333
+ "lines-and-columns": "^1.2.4",
334
+ "load-json-file": "^4.0.0",
335
+ "locate-path": "^2.0.0",
336
+ "lodash": "^4.17.21",
337
+ "lodash-es": "^4.17.21",
338
+ "lodash.capitalize": "^4.2.1",
339
+ "lodash.debounce": "^4.0.8",
340
+ "lodash.escaperegexp": "^4.1.2",
341
+ "lodash.isplainobject": "^4.0.6",
342
+ "lodash.isstring": "^4.0.1",
343
+ "lodash.merge": "^4.6.2",
344
+ "lodash.uniqby": "^4.7.0",
345
+ "lru-cache": "^6.0.0",
346
+ "magic-string": "^0.30.5",
347
+ "make-dir": "^4.0.0",
348
+ "makeerror": "^1.0.12",
349
+ "marked-repo": "^15.0.0",
350
+ "math-intrinsics": "^1.1.0",
351
+ "meow": "^13.2.0",
352
+ "merge-stream": "^2.0.0",
353
+ "merge2": "^1.4.1",
354
+ "micromatch": "^4.0.4",
355
+ "mime": "^4.0.0",
356
+ "mimic-fn": "^2.1.0",
357
+ "minimatch": "^3.1.2",
358
+ "minimist": "^1.2.6",
359
+ "ms": "^2.1.2",
360
+ "mz": "^2.7.0",
361
+ "natural-compare": "^1.4.0",
362
+ "neo-async": "^2.6.2",
363
+ "nerf-dart": "^1.0.0",
364
+ "node-emoji": "^2.1.3",
365
+ "node-int64": "^0.4.0",
366
+ "node-releases": "^2.0.19",
367
+ "normalize-package-data": "^6.0.2",
368
+ "normalize-path": "^3.0.0",
369
+ "normalize-url": "^8.0.0",
370
+ "npm": "^10.8.3",
371
+ "npm-run-path": "^4.0.1",
372
+ "object-assign": "^4.1.1",
373
+ "object-inspect": "^1.13.3",
374
+ "object-keys": "^1.1.1",
375
+ "object.assign": "^4.1.7",
376
+ "object.fromentries": "^2.0.8",
377
+ "object.groupby": "^1.0.3",
378
+ "object.values": "^1.2.1",
379
+ "once": "^1.4.0",
380
+ "onetime": "^5.1.2",
381
+ "optionator": "^0.9.3",
382
+ "own-keys": "^1.0.1",
383
+ "p-each-series": "^3.0.0",
384
+ "p-filter": "^4.0.0",
385
+ "p-is-promise": "^3.0.0",
386
+ "p-limit": "^1.3.0",
387
+ "p-locate": "^2.0.0",
388
+ "p-map": "^7.0.0",
389
+ "p-reduce": "^2.1.0",
390
+ "p-try": "^1.0.0",
391
+ "parent-module": "^1.0.1",
392
+ "parse-json": "^5.2.0",
393
+ "parse-ms": "^4.0.0",
394
+ "parse5": "^5.1.1",
395
+ "parse5-htmlparser2-tree-adapter": "^6.0.1",
396
+ "parse5-sax-parser": "^7.0.0",
397
+ "path-exists": "^3.0.0",
398
+ "path-is-absolute": "^1.0.1",
399
+ "path-key": "^3.1.1",
400
+ "path-parse": "^1.0.7",
401
+ "path-type": "^4.0.0",
402
+ "picocolors": "^1.1.1",
403
+ "picomatch": "^2.3.1",
404
+ "pify": "^3.0.0",
405
+ "pirates": "^4.0.4",
406
+ "pkg-conf": "^2.1.0",
407
+ "possible-typed-array-names": "^1.0.0",
408
+ "prelude-ls": "^1.2.1",
409
+ "pretty-format": "^29.7.0",
410
+ "pretty-ms": "^9.1.0",
411
+ "process-nextick-args": "^2.0.1",
412
+ "prompts": "^2.4.2",
413
+ "proto-list": "^1.2.4",
414
+ "punycode": "^2.3.1",
415
+ "pure-rand": "^6.0.3",
416
+ "q": "^1.5.1",
417
+ "queue-microtask": "^1.2.3",
418
+ "rc": "^1.2.8",
419
+ "react-is": "^18.2.0",
420
+ "read-package-up": "^11.0.0",
421
+ "read-pkg": "^9.0.1",
422
+ "readable-stream": "^2.3.7",
423
+ "reflect.getprototypeof": "^1.0.10",
424
+ "regenerate": "^1.4.2",
425
+ "regenerate-unicode-properties": "^10.2.0",
426
+ "regenerator-runtime": "^0.14.1",
427
+ "regenerator-transform": "^0.15.2",
428
+ "regexp.prototype.flags": "^1.5.4",
429
+ "regexpp": "^3.2.0",
430
+ "regexpu-core": "^6.2.0",
431
+ "registry-auth-token": "^5.0.1",
432
+ "regjsgen": "^0.8.0",
433
+ "regjsparser": "^0.12.0",
434
+ "require-directory": "^2.1.1",
435
+ "resolve": "^1.22.8",
436
+ "resolve-cwd": "^3.0.0",
437
+ "resolve-from": "^4.0.0",
438
+ "resolve.exports": "^2.0.2",
439
+ "reusify": "^1.0.4",
440
+ "rimraf": "^3.0.2",
441
+ "run-parallel": "^1.2.0",
442
+ "safe-array-concat": "^1.1.3",
443
+ "safe-buffer": "^5.1.2",
444
+ "safe-push-apply": "^1.0.0",
445
+ "safe-regex-test": "^1.1.0",
446
+ "semver": "^7.5.4",
447
+ "semver-diff": "^4.0.0",
448
+ "semver-regex": "^4.0.5",
449
+ "set-function-length": "^1.2.2",
450
+ "set-function-name": "^2.0.2",
451
+ "set-proto": "^1.0.0",
452
+ "shebang-command": "^2.0.0",
453
+ "shebang-regex": "^3.0.0",
454
+ "side-channel": "^1.1.0",
455
+ "side-channel-list": "^1.0.0",
456
+ "side-channel-map": "^1.0.1",
457
+ "side-channel-weakmap": "^1.0.2",
458
+ "signal-exit": "^3.0.7",
459
+ "signale": "^1.4.0",
460
+ "sisteransi": "^1.0.5",
461
+ "skin-tone": "^2.0.0",
462
+ "slash": "^3.0.0",
463
+ "source-map": "^0.6.1",
464
+ "source-map-support": "^0.5.13",
465
+ "spawn-error-forwarder": "^1.0.0",
466
+ "spdx-correct": "^3.2.0",
467
+ "spdx-exceptions": "^2.5.0",
468
+ "spdx-expression-parse": "^3.0.1",
469
+ "spdx-license-ids": "^3.0.20",
470
+ "sprintf-js": "^1.0.3",
471
+ "stack-utils": "^2.0.6",
472
+ "stream-combiner2": "^1.1.1",
473
+ "string-length": "^4.0.2",
474
+ "string-width": "^4.2.3",
475
+ "string.prototype.trim": "^1.2.10",
476
+ "string.prototype.trimend": "^1.0.9",
477
+ "string.prototype.trimstart": "^1.0.8",
478
+ "string_decoder": "^1.1.1",
479
+ "strip-ansi": "^6.0.1",
480
+ "strip-bom": "^4.0.0",
481
+ "strip-final-newline": "^2.0.0",
482
+ "strip-json-comments": "^3.1.1",
483
+ "super-regex": "^1.0.0",
484
+ "supports-color": "^7.2.0",
485
+ "supports-hyperlinks": "^3.1.0",
486
+ "supports-preserve-symlinks-flag": "^1.0.0",
487
+ "temp-dir": "^2.0.0",
488
+ "tempy": "^3.0.0",
489
+ "test-exclude": "^6.0.0",
490
+ "text-table": "^0.2.0",
491
+ "thenify": "^3.3.1",
492
+ "thenify-all": "^1.6.0",
493
+ "time-span": "^5.1.0",
494
+ "tmpl": "^1.0.5",
495
+ "to-regex-range": "^5.0.1",
496
+ "traverse": "^0.6.6",
497
+ "tsconfig-paths": "^3.15.0",
498
+ "type-check": "^0.4.0",
499
+ "type-detect": "^4.0.8",
500
+ "type-fest": "^0.20.2",
501
+ "typed-array-buffer": "^1.0.3",
502
+ "typed-array-byte-length": "^1.0.3",
503
+ "typed-array-byte-offset": "^1.0.4",
504
+ "typed-array-length": "^1.0.7",
505
+ "uglify-js": "^3.19.3",
506
+ "unbox-primitive": "^1.1.0",
507
+ "unicode-canonical-property-names-ecmascript": "^2.0.1",
508
+ "unicode-emoji-modifier-base": "^1.0.0",
509
+ "unicode-match-property-ecmascript": "^2.0.0",
510
+ "unicode-match-property-value-ecmascript": "^2.2.0",
511
+ "unicode-property-aliases-ecmascript": "^2.1.0",
512
+ "unicorn-magic": "^0.1.0",
513
+ "unique-string": "^3.0.0",
514
+ "universal-user-agent": "^7.0.2",
515
+ "universalify": "^2.0.0",
516
+ "update-browserslist-db": "^1.1.1",
517
+ "uri-js": "^4.4.1",
518
+ "url-join": "^5.0.0",
519
+ "util-deprecate": "^1.0.2",
520
+ "v8-to-istanbul": "^9.1.0",
521
+ "validate-npm-package-license": "^3.0.4",
522
+ "walker": "^1.0.8",
523
+ "which": "^2.0.2",
524
+ "which-boxed-primitive": "^1.1.1",
525
+ "which-builtin-type": "^1.2.1",
526
+ "which-collection": "^1.0.2",
527
+ "which-typed-array": "^1.1.18",
528
+ "wordwrap": "^1.0.0",
529
+ "wrap-ansi": "^7.0.0",
530
+ "wrappy": "^1.0.2",
531
+ "write-file-atomic": "^4.0.2",
532
+ "xtend": "^4.0.2",
533
+ "y18n": "^5.0.8",
534
+ "yallist": "^4.0.0",
535
+ "yargs": "^17.7.1",
536
+ "yargs-parser": "^20.2.9",
537
+ "yocto-queue": "^0.1.0",
538
+ "yoctocolors": "^2.1.1"
539
+ }
540
+ }
@@ -0,0 +1,10 @@
1
+ module.exports = {
2
+ branches: 'main',
3
+ plugins: [
4
+ '@semantic-release/commit-analyzer',
5
+ '@semantic-release/release-notes-generator',
6
+ '@semantic-release/npm',
7
+ '@semantic-release/github',
8
+ '@semantic-release/git'
9
+ ]
10
+ };
@@ -0,0 +1,17 @@
1
+ export default [
2
+ {
3
+ input: 'src/index.js',
4
+ output: {
5
+ name: 'subsuper-text',
6
+ file: 'lib/index.umd.js',
7
+ format: 'umd'
8
+ }
9
+ },
10
+ {
11
+ input: 'src/index.js',
12
+ output: {
13
+ file: 'lib/index.cjs',
14
+ format: 'cjs'
15
+ }
16
+ }
17
+ ];
@@ -0,0 +1,40 @@
1
+ import { marked } from 'marked';
2
+ import underline from '../src/index.js';
3
+
4
+ function trimLines(s) {
5
+ return s.split('\n').map(l => l.trim()).join('\n');
6
+ }
7
+
8
+
9
+ describe('Correct Standard Usage', ()=>{
10
+ test('Naked Underline', function() {
11
+ const source = '_Underlined!_\n\n';
12
+ const rendered = Markdown.render(source).trim();
13
+ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`<p><u>Underlined!</u></p>`);
14
+ });
15
+
16
+ test('Italicized Underline', function() {
17
+ const source = '_*Underlined and Italicized!*_\n\n';
18
+ const rendered = Markdown.render(source).trim();
19
+ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`<p><u><em>Underlined and Italicized!</em></u></p>`);
20
+ });
21
+
22
+ test('Bold Underline', function() {
23
+ const source = '_**Bold and Underlined!**_\n\n';
24
+ const rendered = Markdown.render(source).trim();
25
+ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`<p><u><strong>Bold and Underlined!</strong></u></p>`);
26
+ });
27
+
28
+ test('Bold and Italicized Underline', function() {
29
+ const source = '_***Bold, Italic, and Underlined? No Way!***_\n\n';
30
+ const rendered = Markdown.render(source).trim();
31
+ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`<p><u><em><strong>Bold, Italic, and Underlined? No Way!</strong></em></u></p>`);
32
+ });
33
+
34
+ test('Across lines', function() {
35
+ const source = '_This Line\n\nand that_\n\n';
36
+ const rendered = Markdown.render(source).trim();
37
+ expect(rendered, `Input:\n${source}`, { showPrefix: false }).toBe(`<p><u><em>This Line and that</u></p>`);
38
+ });
39
+ });
40
+
@@ -0,0 +1,4 @@
1
+ import { runAllMarkedSpecTests } from '@markedjs/testutils';
2
+ import underline from '../src/index.js';
3
+
4
+ runAllMarkedSpecTests({ addExtension: (marked) => { marked.use({ extensions: [underline] }); }, outputCompletionTables: true });
package/src/index.js ADDED
@@ -0,0 +1,25 @@
1
+ export default function() {
2
+ return {
3
+ extensions: [
4
+ {
5
+ name : 'underline',
6
+ level : 'inline',
7
+ start(src) { return src.match(/\b_([^_]*?)_\b/m)?.index;},
8
+ tokenizer(src, tokens) {
9
+ const regex = /^\b_([^_]*?)_\b/m;
10
+ const match = regex.exec(src);
11
+ if(match?.length) {
12
+ return {
13
+ type : 'underline',
14
+ raw : match[0],
15
+ tokens : this.lexer.inlineTokens(match[1])
16
+ };
17
+ }
18
+ },
19
+ renderer(token) {
20
+ return `<u>${this.parser.parseInline(token.tokens)}</u>`;
21
+ }
22
+ }
23
+ ]
24
+ };
25
+ }