diff --git a/.travis.yml b/.travis.yml index c429dc2..a5d744c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,4 @@ language: node_js node_js: - - '8' + - '22' sudo: false diff --git a/index.js b/index.js index 9390782..33d5d16 100644 --- a/index.js +++ b/index.js @@ -1,6 +1,5 @@ // Process @[osf](guid0) - const EMBED_REGEX = /@\[([a-zA-Z].+)]\([\s]*(.*?)[\s]*[)]/im; function assetEmbed(md, options) { @@ -12,8 +11,8 @@ function assetEmbed(md, options) { var theState = state; const oldPos = state.pos; - if (state.src.charCodeAt(oldPos) !== 0x40/* @ */ || - state.src.charCodeAt(oldPos + 1) !== 0x5B/* [ */) { + if (state.src.charCodeAt(oldPos) !== 0x40 + ||/* @ */ state.src.charCodeAt(oldPos + 1) !== 0x5B/* [ */) { return false; } diff --git a/package.json b/package.json index d0dac30..c4e13f4 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@centerforopenscience/markdown-it-atrules", - "version": "0.1.1", + "version": "0.1.2", "description": "Markdown-it plugin to embed files with the OSF's MFR", "main": "index.js", "scripts": { @@ -24,18 +24,16 @@ "publishConfig": { "access": "public" }, - "dependencies": { - "np": "^3.0.4" - }, "devDependencies": { - "eslint": "^4.9.0", - "eslint-config-airbnb": "^16.1.0", - "eslint-plugin-import": "^2.7.0", - "eslint-plugin-jsx-a11y": "^6.0.2", + "eslint": "^8.57.1", + "eslint-config-airbnb": "^19.0.4", + "eslint-plugin-import": "^2.32.0", + "eslint-plugin-jsx-a11y": "^6.10.2", "eslint-plugin-nodeca": "1.0.3", - "eslint-plugin-react": "^7.4.0", - "markdown-it": "8.4.0", - "markdown-it-testgen": "0.1.4", - "mocha": "4.0.1" + "eslint-plugin-react": "^7.37.5", + "markdown-it": "14.1.1", + "markdown-it-testgen": "0.1.6", + "mocha": "11.7.5", + "np": "^11.0.3" } } diff --git a/test/test.js b/test/test.js index bafae3b..aa1c387 100644 --- a/test/test.js +++ b/test/test.js @@ -20,13 +20,13 @@ describe('markdown-it-atrules', function () { html: true, linkify: true, typography: true, - }).use(require('../'), { + }).use(require('..'), { type: 'osf', pattern: /^http(?:s?):\/\/(?:www\.)?[a-zA-Z0-9 .:]{1,}\/render\?url=http(?:s?):\/\/[a-zA-Z0-9 .:]{1,}\/([a-zA-Z0-9]{5})\/\?action=download|(^[a-zA-Z0-9]{5}$)/, format(assetID) { var cssId = '__markdown-it-atrules-' + (new Date()).getTime(); - return '
' + - ''; + return '
' + + ''; }, });