TagSpaces is an offline, open source, document manager with tagging support
chore: updating dompurify, reintroducing remove-markdown
Ilian Sapundshiev6f29fa7668a7
diff --git a/package-lock.json b/package-lock.jsonindex 65c926731..f5013e319 100644--- a/package-lock.json+++ b/package-lock.json@@ -31,7 +31,7 @@"coordinate-parser": "^1.0.7","crypto-js": "^4.1.1","date-fns": "^2.29.3",- "dompurify": "^2.3.3",+ "dompurify": "^3.0.11","echarts": "^5.4.3","electron-context-menu": "^3.6.1","electron-debug": "^3.2.0",@@ -77,6 +77,7 @@"redux": "^4.2.0","redux-persist": "^5.10.0","redux-thunk": "^2.4.1",+ "remove-markdown": "^0.5.0","semver": "^7.3.5","slick-carousel": "^1.8.1","source-map-support": "^0.5.21",@@ -196,7 +197,7 @@"yarn": "please-use-npm"},"optionalDependencies": {- "@tagspacespro/tagspacespro": "5.0.23"+ "@tagspacespro/tagspacespro": "5.0.25"}},"node_modules/@aashutoshrathi/word-wrap": {@@ -13595,9 +13596,9 @@}},"node_modules/@tagspacespro/tagspacespro": {- "version": "5.0.23",- "resolved": "https://npm.pkg.github.com/download/@tagspacespro/tagspacespro/5.0.23/a2a0ea4abe96d5c6be2e041ddf1aaac4001ace9d",- "integrity": "sha512-+IVCbMKTNklfwSTk49x9nEm6zWkDhXr82XzpGp+AGaJytwk6QlR8AjGLE85LbYWcVmZf1DZ6iPdwuS1jXLW4aA==",+ "version": "5.0.25",+ "resolved": "https://npm.pkg.github.com/download/@tagspacespro/tagspacespro/5.0.25/8df133f27ccf292e7d4cc96acaf927d31393f7d6",+ "integrity": "sha512-TJL1Si4V4XCMBgOlPABzFNN1lZrX3x/VZHYTj3qDIz7ZD7HeyvojNuiV2gZ/CwHN1C5AxVPBx/BSoEhO1cLUrw==","license": "Proprietary","optional": true},@@ -20144,9 +20145,9 @@}},"node_modules/dompurify": {- "version": "2.4.7",- "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.4.7.tgz",- "integrity": "sha512-kxxKlPEDa6Nc5WJi+qRgPbOAbgTpSULL+vI3NUXsZMlkJxTqYI9wg5ZTay2sFrdZRWHPWNi+EdAhcJf81WtoMQ=="+ "version": "3.0.11",+ "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.0.11.tgz",+ "integrity": "sha512-Fan4uMuyB26gFV3ovPoEoQbxRRPfTu3CvImyZnhGq5fsIEO+gEFLp45ISFt+kQBWsK5ulDdT0oV28jS1UrwQLg=="},"node_modules/domutils": {"version": "2.8.0",@@ -33439,11 +33440,6 @@"web-worker": "^1.2.0"}},- "node_modules/mermaid/node_modules/dompurify": {- "version": "3.0.9",- "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.0.9.tgz",- "integrity": "sha512-uyb4NDIvQ3hRn6NiC+SIFaP4mJ/MdXlvtunaqK9Bn6dD3RuB/1S/gasEjDHD8eiaqdSael2vBv+hOs7Y+jhYOQ=="- },"node_modules/methods": {"version": "1.1.2","resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",@@ -43214,6 +43210,11 @@"@types/unist": "*"}},+ "node_modules/remove-markdown": {+ "version": "0.5.0",+ "resolved": "https://registry.npmjs.org/remove-markdown/-/remove-markdown-0.5.0.tgz",+ "integrity": "sha512-x917M80K97K5IN1L8lUvFehsfhR8cYjGQ/yAMRI9E7JIKivtl5Emo5iD13DhMr+VojzMCiYk8V2byNPwT/oapg=="+ },"node_modules/remove-trailing-separator": {"version": "1.1.0","resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",@@ -59234,9 +59235,9 @@}},"@tagspacespro/tagspacespro": {- "version": "5.0.23",- "resolved": "https://npm.pkg.github.com/download/@tagspacespro/tagspacespro/5.0.23/a2a0ea4abe96d5c6be2e041ddf1aaac4001ace9d",- "integrity": "sha512-+IVCbMKTNklfwSTk49x9nEm6zWkDhXr82XzpGp+AGaJytwk6QlR8AjGLE85LbYWcVmZf1DZ6iPdwuS1jXLW4aA==",+ "version": "5.0.25",+ "resolved": "https://npm.pkg.github.com/download/@tagspacespro/tagspacespro/5.0.25/8df133f27ccf292e7d4cc96acaf927d31393f7d6",+ "integrity": "sha512-TJL1Si4V4XCMBgOlPABzFNN1lZrX3x/VZHYTj3qDIz7ZD7HeyvojNuiV2gZ/CwHN1C5AxVPBx/BSoEhO1cLUrw==","optional": true},"@teamsupercell/typings-for-css-modules-loader": {@@ -64330,9 +64331,9 @@}},"dompurify": {- "version": "2.4.7",- "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-2.4.7.tgz",- "integrity": "sha512-kxxKlPEDa6Nc5WJi+qRgPbOAbgTpSULL+vI3NUXsZMlkJxTqYI9wg5ZTay2sFrdZRWHPWNi+EdAhcJf81WtoMQ=="+ "version": "3.0.11",+ "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.0.11.tgz",+ "integrity": "sha512-Fan4uMuyB26gFV3ovPoEoQbxRRPfTu3CvImyZnhGq5fsIEO+gEFLp45ISFt+kQBWsK5ulDdT0oV28jS1UrwQLg=="},"domutils": {"version": "2.8.0",@@ -73809,13 +73810,6 @@"ts-dedent": "^2.2.0","uuid": "^9.0.0","web-worker": "^1.2.0"- },- "dependencies": {- "dompurify": {- "version": "3.0.9",- "resolved": "https://registry.npmjs.org/dompurify/-/dompurify-3.0.9.tgz",- "integrity": "sha512-uyb4NDIvQ3hRn6NiC+SIFaP4mJ/MdXlvtunaqK9Bn6dD3RuB/1S/gasEjDHD8eiaqdSael2vBv+hOs7Y+jhYOQ=="- }}},"methods": {@@ -80603,6 +80597,11 @@}}},+ "remove-markdown": {+ "version": "0.5.0",+ "resolved": "https://registry.npmjs.org/remove-markdown/-/remove-markdown-0.5.0.tgz",+ "integrity": "sha512-x917M80K97K5IN1L8lUvFehsfhR8cYjGQ/yAMRI9E7JIKivtl5Emo5iD13DhMr+VojzMCiYk8V2byNPwT/oapg=="+ },"remove-trailing-separator": {"version": "1.1.0","resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz",diff --git a/package.json b/package.jsonindex 389049d60..eed552fa5 100644--- a/package.json+++ b/package.json@@ -169,7 +169,7 @@"coordinate-parser": "^1.0.7","crypto-js": "^4.1.1","date-fns": "^2.29.3",- "dompurify": "^2.3.3",+ "dompurify": "^3.0.11","echarts": "^5.4.3","electron-context-menu": "^3.6.1","electron-debug": "^3.2.0",@@ -215,6 +215,7 @@"redux": "^4.2.0","redux-persist": "^5.10.0","redux-thunk": "^2.4.1",+ "remove-markdown": "^0.5.0","semver": "^7.3.5","slick-carousel": "^1.8.1","source-map-support": "^0.5.21",diff --git a/release/app/package-lock.json b/release/app/package-lock.jsonindex a0be4e167..5337165bf 100644--- a/release/app/package-lock.json+++ b/release/app/package-lock.json@@ -1,12 +1,12 @@{"name": "tagspaces",- "version": "5.7.11",+ "version": "5.7.12","lockfileVersion": 2,"requires": true,"packages": {"": {"name": "tagspaces",- "version": "5.7.11",+ "version": "5.7.12","hasInstallScript": true,"license": "AGPL-3.0","dependencies": {diff --git a/src/renderer/perspectives/grid/components/GridPagination.tsx b/src/renderer/perspectives/grid/components/GridPagination.tsxindex 640e44094..10088079e 100644--- a/src/renderer/perspectives/grid/components/GridPagination.tsx+++ b/src/renderer/perspectives/grid/components/GridPagination.tsx@@ -211,7 +211,7 @@ function GridPagination(props: Props) {data-tid={'currentDir_' + folderName}style={{fontSize: '1.5rem',- filter: `drop-shadow(0px 0px 2px ${theme.palette.background.default})`,+ filter: `drop-shadow(0px 0px 4px ${theme.palette.background.default})`,}}onClick={() => {setSelectedEntries([]);@@ -246,7 +246,7 @@ function GridPagination(props: Props) {<Typographystyle={{fontSize: '0.9rem',- filter: `drop-shadow(0px 0px 2px ${theme.palette.background.default})`,+ filter: `drop-shadow(0px 0px 4px ${theme.palette.background.default})`,}}>{folderSummary}@@ -461,22 +461,4 @@ function GridPagination(props: Props) {);}-/*const areEqual = (prevProp: Props, nextProp: Props) =>- JSON.stringify(nextProp.lastBackgroundImageChange) ===- JSON.stringify(prevProp.lastBackgroundImageChange) &&- JSON.stringify(nextProp.lastThumbnailImageChange) ===- JSON.stringify(prevProp.lastThumbnailImageChange) &&- nextProp.currentDirectoryPath === prevProp.currentDirectoryPath &&- //nextProp.showDirectories === prevProp.showDirectories &&- //nextProp.showDetails === prevProp.showDetails &&- //nextProp.showDescription === prevProp.showDescription &&- //nextProp.showTags === prevProp.showTags &&- //nextProp.gridPageLimit === prevProp.gridPageLimit &&- JSON.stringify(nextProp.files) === JSON.stringify(prevProp.files) &&- JSON.stringify(nextProp.directories) ===- JSON.stringify(prevProp.directories) &&- // JSON.stringify(nextProp.settings) === JSON.stringify(prevProp.settings) &&- JSON.stringify(nextProp.selectedEntries) ===- JSON.stringify(prevProp.selectedEntries);*/-export default GridPagination;diff --git a/src/renderer/services/utils-io.ts b/src/renderer/services/utils-io.tsindex cf7a477ac..4d90379ef 100644--- a/src/renderer/services/utils-io.ts+++ b/src/renderer/services/utils-io.ts@@ -56,6 +56,7 @@ import { base64ToArrayBuffer } from '-/utils/dom';import { Pro } from '-/pro';import { supportedFileTypes } from '-/extension-config';import { getEnhancedDir, getEnhancedFile } from '-/services/meta-loader';+import removeMd from 'remove-markdown';export function getAllTags(entry: TS.FileSystemEntry): Array<TS.Tag> {const tags = [];@@ -1265,14 +1266,15 @@ export function loadFileContentPromise(*/export function getDescriptionPreview(mdContent, maxLength = 200) {if (!mdContent) return '';- let preview = mdContent- .replace(- /\[(.*?)\]\(.*?\)/g, // remove link href, also dataurls- // /\(data:([\w\/\+]+);(charset=[\w-]+|base64).*,([a-zA-Z0-9+/]+={0,2})\)/g,- '',- )- .replace(/<[^>]*>/g, '') // remove html- .replace(/\*|~|#|_/g, '');+ // let preview = mdContent+ // .replace(+ // /\[(.*?)\]\(.*?\)/g, // remove link href, also dataurls+ // // /\(data:([\w\/\+]+);(charset=[\w-]+|base64).*,([a-zA-Z0-9+/]+={0,2})\)/g,+ // '',+ // )+ // .replace(/<[^>]*>/g, '') // remove html+ // .replace(/\*|~|#|_/g, '');+ let preview = removeMd(mdContent);if (preview.length > maxLength) {preview = preview.substring(0, maxLength) + '...';}