From fdea0b253d100b4b43ad7ff36d43699997e1c353 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Thu, 9 Nov 2023 16:18:35 +0100 Subject: [PATCH 01/32] use fixed dependency versions --- npm-shrinkwrap.json | 223 ++++++++++++++++++++++++++------------------ package.json | 39 ++++---- 2 files changed, 153 insertions(+), 109 deletions(-) diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 34618c2..79ee8a1 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -1,34 +1,36 @@ { "name": "confluence-markup", - "version": "1.0.1", + "version": "1.0.2", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "confluence-markup", - "version": "1.0.1", + "version": "1.0.2", "license": "MIT", "devDependencies": { - "@types/glob": "^8.1.0", - "@types/mocha": "^10.0.3", - "@types/node": "^20.8.10", - "@types/vscode": "^1.84.0", - "@typescript-eslint/eslint-plugin": "^6.9.1", - "@typescript-eslint/parser": "^6.9.1", - "@vscode/test-electron": "^2.3.6", - "@vscode/vsce": "^2.22.0", - "eslint": "^8.5.2", - "glob": "^10.2.10", - "html-formatter": "^0.1.9", - "mocha": "^10.2.0", - "ovsx": "^0.8.3", - "rimraf": "^5.0.5", - "run-script-os": "^1.1.6", - "source-map-support": "^0.5.12", - "typescript": "^5.2.2" - }, - "engines": { - "vscode": "^1.40.0" + "@prettier/sync": "^0.3.0", + "@types/glob": "8.1.0", + "@types/mocha": "10.0.4", + "@types/node": "20.9.0", + "@types/vscode": "1.84.1", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@typescript-eslint/parser": "6.10.0", + "@vscode/test-electron": "2.3.6", + "@vscode/vsce": "2.22.0", + "eslint": "8.53.0", + "glob": "10.3.10", + "html-formatter": "0.1.9", + "mocha": "10.2.0", + "ovsx": "0.8.3", + "prettier": "^3.0.3", + "rimraf": "5.0.5", + "run-script-os": "1.1.6", + "source-map-support": "0.5.21", + "typescript": "5.2.2" + }, + "engines": { + "vscode": "^1.75.0" } }, "node_modules/@aashutoshrathi/word-wrap": { @@ -88,9 +90,9 @@ } }, "node_modules/@eslint/js": { - "version": "8.52.0", - "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.52.0.tgz", - "integrity": "sha512-mjZVbpaeMZludF2fsWLD0Z9gCref1Tk4i9+wddjRvpUNqqcndPkBD09N/Mapey0b3jaXbLm2kICwFv2E64QinA==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.53.0.tgz", + "integrity": "sha512-Kn7K8dx/5U6+cT1yEhpX1w4PCSg0M+XyRILPgvwcEBjerFWCwQj5sbr3/VmxqV0JGHCBCzyd6LxypEuehypY1w==", "dev": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -218,6 +220,18 @@ "node": ">=14" } }, + "node_modules/@prettier/sync": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@prettier/sync/-/sync-0.3.0.tgz", + "integrity": "sha512-3dcmCyAxIcxy036h1I7MQU/uEEBq8oLwf1CE3xeze+MPlgkdlb/+w6rGR/1dhp6Hqi17fRS6nvwnOzkESxEkOw==", + "dev": true, + "funding": { + "url": "https://github.com/prettier/prettier-synchronized?sponsor=1" + }, + "peerDependencies": { + "prettier": "^3.0.0" + } + }, "node_modules/@tootallnate/once": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", @@ -238,9 +252,9 @@ } }, "node_modules/@types/json-schema": { - "version": "7.0.14", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.14.tgz", - "integrity": "sha512-U3PUjAudAdJBeC2pgN8uTIKgxrb4nlDF3SF0++EldXQvQBGkpFZMSnwQiIoDU77tv45VgNkl/L4ouD+rEomujw==", + "version": "7.0.15", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz", + "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, "node_modules/@types/minimatch": { @@ -250,43 +264,43 @@ "dev": true }, "node_modules/@types/mocha": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.3.tgz", - "integrity": "sha512-RsOPImTriV/OE4A9qKjMtk2MnXiuLLbcO3nCXK+kvq4nr0iMfFgpjaX3MPLb6f7+EL1FGSelYvuJMV6REH+ZPQ==", + "version": "10.0.4", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-10.0.4.tgz", + "integrity": "sha512-xKU7bUjiFTIttpWaIZ9qvgg+22O1nmbA+HRxdlR+u6TWsGfmFdXrheJoK4fFxrHNVIOBDvDNKZG+LYBpMHpX3w==", "dev": true }, "node_modules/@types/node": { - "version": "20.8.10", - "resolved": "https://registry.npmjs.org/@types/node/-/node-20.8.10.tgz", - "integrity": "sha512-TlgT8JntpcbmKUFzjhsyhGfP2fsiz1Mv56im6enJ905xG1DAYesxJaeSbGqQmAw8OWPdhyJGhGSQGKRNJ45u9w==", + "version": "20.9.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-20.9.0.tgz", + "integrity": "sha512-nekiGu2NDb1BcVofVcEKMIwzlx4NjHlcjhoxxKBNLtz15Y1z7MYf549DFvkHSId02Ax6kGwWntIBPC3l/JZcmw==", "dev": true, "dependencies": { "undici-types": "~5.26.4" } }, "node_modules/@types/semver": { - "version": "7.5.4", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.4.tgz", - "integrity": "sha512-MMzuxN3GdFwskAnb6fz0orFvhfqi752yjaXylr0Rp4oDg5H0Zn1IuyRhDVvYOwAXoJirx2xuS16I3WjxnAIHiQ==", + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.5.tgz", + "integrity": "sha512-+d+WYC1BxJ6yVOgUgzK8gWvp5qF8ssV5r4nsDcZWKRWcDQLQ619tvWAxJQYGgBrO1MnLJC7a5GtiYsAoQ47dJg==", "dev": true }, "node_modules/@types/vscode": { - "version": "1.84.0", - "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.84.0.tgz", - "integrity": "sha512-lCGOSrhT3cL+foUEqc8G1PVZxoDbiMmxgnUZZTEnHF4mC47eKAUtBGAuMLY6o6Ua8PAuNCoKXbqPmJd1JYnQfg==", + "version": "1.84.1", + "resolved": "https://registry.npmjs.org/@types/vscode/-/vscode-1.84.1.tgz", + "integrity": "sha512-DB10vBRLEPA/us7p3gQilU2Tq5HDu6JWTyCpD9qtb7MKWIvJS5In9HU3YgVGCXf/miwHJiY62aXwjtUSMpT8HA==", "dev": true }, "node_modules/@typescript-eslint/eslint-plugin": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.9.1.tgz", - "integrity": "sha512-w0tiiRc9I4S5XSXXrMHOWgHgxbrBn1Ro+PmiYhSg2ZVdxrAJtQgzU5o2m1BfP6UOn7Vxcc6152vFjQfmZR4xEg==", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-6.10.0.tgz", + "integrity": "sha512-uoLj4g2OTL8rfUQVx2AFO1hp/zja1wABJq77P6IclQs6I/m9GLrm7jCdgzZkvWdDCQf1uEvoa8s8CupsgWQgVg==", "dev": true, "dependencies": { "@eslint-community/regexpp": "^4.5.1", - "@typescript-eslint/scope-manager": "6.9.1", - "@typescript-eslint/type-utils": "6.9.1", - "@typescript-eslint/utils": "6.9.1", - "@typescript-eslint/visitor-keys": "6.9.1", + "@typescript-eslint/scope-manager": "6.10.0", + "@typescript-eslint/type-utils": "6.10.0", + "@typescript-eslint/utils": "6.10.0", + "@typescript-eslint/visitor-keys": "6.10.0", "debug": "^4.3.4", "graphemer": "^1.4.0", "ignore": "^5.2.4", @@ -312,15 +326,15 @@ } }, "node_modules/@typescript-eslint/parser": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.9.1.tgz", - "integrity": "sha512-C7AK2wn43GSaCUZ9do6Ksgi2g3mwFkMO3Cis96kzmgudoVaKyt62yNzJOktP0HDLb/iO2O0n2lBOzJgr6Q/cyg==", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.10.0.tgz", + "integrity": "sha512-+sZwIj+s+io9ozSxIWbNB5873OSdfeBEH/FR0re14WLI6BaKuSOnnwCJ2foUiu8uXf4dRp1UqHP0vrZ1zXGrog==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.9.1", - "@typescript-eslint/types": "6.9.1", - "@typescript-eslint/typescript-estree": "6.9.1", - "@typescript-eslint/visitor-keys": "6.9.1", + "@typescript-eslint/scope-manager": "6.10.0", + "@typescript-eslint/types": "6.10.0", + "@typescript-eslint/typescript-estree": "6.10.0", + "@typescript-eslint/visitor-keys": "6.10.0", "debug": "^4.3.4" }, "engines": { @@ -340,13 +354,13 @@ } }, "node_modules/@typescript-eslint/scope-manager": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.9.1.tgz", - "integrity": "sha512-38IxvKB6NAne3g/+MyXMs2Cda/Sz+CEpmm+KLGEM8hx/CvnSRuw51i8ukfwB/B/sESdeTGet1NH1Wj7I0YXswg==", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.10.0.tgz", + "integrity": "sha512-TN/plV7dzqqC2iPNf1KrxozDgZs53Gfgg5ZHyw8erd6jd5Ta/JIEcdCheXFt9b1NYb93a1wmIIVW/2gLkombDg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.9.1", - "@typescript-eslint/visitor-keys": "6.9.1" + "@typescript-eslint/types": "6.10.0", + "@typescript-eslint/visitor-keys": "6.10.0" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -357,13 +371,13 @@ } }, "node_modules/@typescript-eslint/type-utils": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.9.1.tgz", - "integrity": "sha512-eh2oHaUKCK58qIeYp19F5V5TbpM52680sB4zNSz29VBQPTWIlE/hCj5P5B1AChxECe/fmZlspAWFuRniep1Skg==", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-6.10.0.tgz", + "integrity": "sha512-wYpPs3hgTFblMYwbYWPT3eZtaDOjbLyIYuqpwuLBBqhLiuvJ+9sEp2gNRJEtR5N/c9G1uTtQQL5AhV0fEPJYcg==", "dev": true, "dependencies": { - "@typescript-eslint/typescript-estree": "6.9.1", - "@typescript-eslint/utils": "6.9.1", + "@typescript-eslint/typescript-estree": "6.10.0", + "@typescript-eslint/utils": "6.10.0", "debug": "^4.3.4", "ts-api-utils": "^1.0.1" }, @@ -384,9 +398,9 @@ } }, "node_modules/@typescript-eslint/types": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.9.1.tgz", - "integrity": "sha512-BUGslGOb14zUHOUmDB2FfT6SI1CcZEJYfF3qFwBeUrU6srJfzANonwRYHDpLBuzbq3HaoF2XL2hcr01c8f8OaQ==", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.10.0.tgz", + "integrity": "sha512-36Fq1PWh9dusgo3vH7qmQAj5/AZqARky1Wi6WpINxB6SkQdY5vQoT2/7rW7uBIsPDcvvGCLi4r10p0OJ7ITAeg==", "dev": true, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -397,13 +411,13 @@ } }, "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.9.1.tgz", - "integrity": "sha512-U+mUylTHfcqeO7mLWVQ5W/tMLXqVpRv61wm9ZtfE5egz7gtnmqVIw9ryh0mgIlkKk9rZLY3UHygsBSdB9/ftyw==", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.10.0.tgz", + "integrity": "sha512-ek0Eyuy6P15LJVeghbWhSrBCj/vJpPXXR+EpaRZqou7achUWL8IdYnMSC5WHAeTWswYQuP2hAZgij/bC9fanBg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.9.1", - "@typescript-eslint/visitor-keys": "6.9.1", + "@typescript-eslint/types": "6.10.0", + "@typescript-eslint/visitor-keys": "6.10.0", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -424,17 +438,17 @@ } }, "node_modules/@typescript-eslint/utils": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.9.1.tgz", - "integrity": "sha512-L1T0A5nFdQrMVunpZgzqPL6y2wVreSyHhKGZryS6jrEN7bD9NplVAyMryUhXsQ4TWLnZmxc2ekar/lSGIlprCA==", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.10.0.tgz", + "integrity": "sha512-v+pJ1/RcVyRc0o4wAGux9x42RHmAjIGzPRo538Z8M1tVx6HOnoQBCX/NoadHQlZeC+QO2yr4nNSFWOoraZCAyg==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.4.0", "@types/json-schema": "^7.0.12", "@types/semver": "^7.5.0", - "@typescript-eslint/scope-manager": "6.9.1", - "@typescript-eslint/types": "6.9.1", - "@typescript-eslint/typescript-estree": "6.9.1", + "@typescript-eslint/scope-manager": "6.10.0", + "@typescript-eslint/types": "6.10.0", + "@typescript-eslint/typescript-estree": "6.10.0", "semver": "^7.5.4" }, "engines": { @@ -449,12 +463,12 @@ } }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.9.1", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.9.1.tgz", - "integrity": "sha512-MUaPUe/QRLEffARsmNfmpghuQkW436DvESW+h+M52w0coICHRfD6Np9/K6PdACwnrq1HmuLl+cSPZaJmeVPkSw==", + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.10.0.tgz", + "integrity": "sha512-xMGluxQIEtOM7bqFCo+rCMh5fqI+ZxV5RUUOa29iVPz1OgCZrtc7rFnz5cLUazlkPKYqX+75iuDq7m0HQ48nCg==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.9.1", + "@typescript-eslint/types": "6.10.0", "eslint-visitor-keys": "^3.4.1" }, "engines": { @@ -1321,15 +1335,15 @@ } }, "node_modules/eslint": { - "version": "8.52.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.52.0.tgz", - "integrity": "sha512-zh/JHnaixqHZsolRB/w9/02akBk9EPrOs9JwcTP2ek7yL5bVvXuRariiaAjjoJ5DvuwQ1WAE/HsMz+w17YgBCg==", + "version": "8.53.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.53.0.tgz", + "integrity": "sha512-N4VuiPjXDUa4xVeV/GC/RV3hQW9Nw+Y463lkWaKKXKYMvmRiRDAtfpuPFLN+E1/6ZhyR8J2ig+eVREnYgUsiag==", "dev": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", - "@eslint/eslintrc": "^2.1.2", - "@eslint/js": "8.52.0", + "@eslint/eslintrc": "^2.1.3", + "@eslint/js": "8.53.0", "@humanwhocodes/config-array": "^0.11.13", "@humanwhocodes/module-importer": "^1.0.1", "@nodelib/fs.walk": "^1.2.8", @@ -1561,9 +1575,9 @@ "dev": true }, "node_modules/fast-glob": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.1.tgz", - "integrity": "sha512-kNFPyjhh5cKjrUltxs+wFx+ZkbRaxxmZ+X0ZU31SOsxCEtP9VPgtq2teZw1DebupL5GmDaNQ6yKMMVcM41iqDg==", + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", + "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", @@ -1771,6 +1785,20 @@ "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", "dev": true }, + "node_modules/fsevents": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", + "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", + "dev": true, + "hasInstallScript": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" + } + }, "node_modules/function-bind": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", @@ -3078,6 +3106,21 @@ "node": ">= 0.8.0" } }, + "node_modules/prettier": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.0.3.tgz", + "integrity": "sha512-L/4pUDMxcNa8R/EthV08Zt42WBO4h1rarVtK0K+QJG0X187OLo7l699jWw0GKuwzkPQ//jMFA/8Xm6Fh3J/DAg==", + "dev": true, + "bin": { + "prettier": "bin/prettier.cjs" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/prettier/prettier?sponsor=1" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", diff --git a/package.json b/package.json index 8f552f5..de2833d 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,7 @@ "engines": { "vscode": "^1.75.0" }, - "activationEvents": [ - ], + "activationEvents": [], "main": "./out/extension", "contributes": { "configuration": { @@ -134,23 +133,25 @@ "changelog": "if [ $((grep \"$(grep -m1 'version' package.json | cut -d '\"' -f 4)\" -n CHANGELOG.md || echo 0) | cut -d ':' -f 1) -eq 3 ]; then awk '/##/{++c;next} c==1' CHANGELOG.md | awk '!/^$/'; else >&2 echo 'Unchecked version'; exit 1; fi" }, "devDependencies": { - "@types/glob": "^8.1.0", - "@types/mocha": "^10.0.3", - "@types/node": "^20.8.10", - "@types/vscode": "^1.75.0", - "@typescript-eslint/eslint-plugin": "^6.9.1", - "@typescript-eslint/parser": "^6.9.1", - "eslint": "^8.5.2", - "glob": "^10.2.10", - "html-formatter": "^0.1.9", - "mocha": "^10.2.0", - "ovsx": "^0.8.3", - "rimraf": "^5.0.5", - "run-script-os": "^1.1.6", - "source-map-support": "^0.5.12", - "typescript": "^5.2.2", - "@vscode/vsce": "^2.22.0", - "@vscode/test-electron": "^2.3.6" + "@prettier/sync": "^0.3.0", + "@types/glob": "8.1.0", + "@types/mocha": "10.0.4", + "@types/node": "20.9.0", + "@types/vscode": "1.84.1", + "@typescript-eslint/eslint-plugin": "6.10.0", + "@typescript-eslint/parser": "6.10.0", + "@vscode/test-electron": "2.3.6", + "@vscode/vsce": "2.22.0", + "eslint": "8.53.0", + "glob": "10.3.10", + "html-formatter": "0.1.9", + "mocha": "10.2.0", + "ovsx": "0.8.3", + "prettier": "^3.0.3", + "rimraf": "5.0.5", + "run-script-os": "1.1.6", + "source-map-support": "0.5.21", + "typescript": "5.2.2" }, "eslintConfig": { "env": { From d1214c1ea5a01535a8d5a06b1b411dc79cdf6b42 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Thu, 9 Nov 2023 16:22:02 +0100 Subject: [PATCH 02/32] use common test files for all line endings --- .../{nix => common}/issue_41.confluence | 0 .../{nix => common}/issue_44.confluence | 0 .../{nix => common}/issue_6.confluence | 0 .../{nix => common}/issues.confluence | 0 .../scoped/colortext.confluence | 0 .../scoped/headings.confluence | 0 .../{nix => common}/scoped/images.confluence | 0 .../{nix => common}/scoped/links.confluence | 0 .../{nix => common}/scoped/lists.confluence | 0 .../{nix => common}/scoped/tables.confluence | 0 .../testfiles/{nix => common}/test.confluence | 0 .../testfiles/win/issue_41.confluence | 79 ----------- .../testfiles/win/issue_44.confluence | 32 ----- .../fixtures/testfiles/win/issue_6.confluence | 20 --- .../fixtures/testfiles/win/issues.confluence | 127 ------------------ .../testfiles/win/scoped/colortext.confluence | 8 -- .../testfiles/win/scoped/headings.confluence | 11 -- .../testfiles/win/scoped/links.confluence | 23 ---- .../testfiles/win/scoped/lists.confluence | 95 ------------- .../testfiles/win/scoped/tables.confluence | 29 ---- .../fixtures/testfiles/win/test.confluence | 116 ---------------- 21 files changed, 540 deletions(-) rename src/test/suite/fixtures/testfiles/{nix => common}/issue_41.confluence (100%) rename src/test/suite/fixtures/testfiles/{nix => common}/issue_44.confluence (100%) rename src/test/suite/fixtures/testfiles/{nix => common}/issue_6.confluence (100%) rename src/test/suite/fixtures/testfiles/{nix => common}/issues.confluence (100%) rename src/test/suite/fixtures/testfiles/{nix => common}/scoped/colortext.confluence (100%) rename src/test/suite/fixtures/testfiles/{nix => common}/scoped/headings.confluence (100%) rename src/test/suite/fixtures/testfiles/{nix => common}/scoped/images.confluence (100%) rename src/test/suite/fixtures/testfiles/{nix => common}/scoped/links.confluence (100%) rename src/test/suite/fixtures/testfiles/{nix => common}/scoped/lists.confluence (100%) rename src/test/suite/fixtures/testfiles/{nix => common}/scoped/tables.confluence (100%) rename src/test/suite/fixtures/testfiles/{nix => common}/test.confluence (100%) delete mode 100644 src/test/suite/fixtures/testfiles/win/issue_41.confluence delete mode 100644 src/test/suite/fixtures/testfiles/win/issue_44.confluence delete mode 100644 src/test/suite/fixtures/testfiles/win/issue_6.confluence delete mode 100644 src/test/suite/fixtures/testfiles/win/issues.confluence delete mode 100644 src/test/suite/fixtures/testfiles/win/scoped/colortext.confluence delete mode 100644 src/test/suite/fixtures/testfiles/win/scoped/headings.confluence delete mode 100644 src/test/suite/fixtures/testfiles/win/scoped/links.confluence delete mode 100644 src/test/suite/fixtures/testfiles/win/scoped/lists.confluence delete mode 100644 src/test/suite/fixtures/testfiles/win/scoped/tables.confluence delete mode 100644 src/test/suite/fixtures/testfiles/win/test.confluence diff --git a/src/test/suite/fixtures/testfiles/nix/issue_41.confluence b/src/test/suite/fixtures/testfiles/common/issue_41.confluence similarity index 100% rename from src/test/suite/fixtures/testfiles/nix/issue_41.confluence rename to src/test/suite/fixtures/testfiles/common/issue_41.confluence diff --git a/src/test/suite/fixtures/testfiles/nix/issue_44.confluence b/src/test/suite/fixtures/testfiles/common/issue_44.confluence similarity index 100% rename from src/test/suite/fixtures/testfiles/nix/issue_44.confluence rename to src/test/suite/fixtures/testfiles/common/issue_44.confluence diff --git a/src/test/suite/fixtures/testfiles/nix/issue_6.confluence b/src/test/suite/fixtures/testfiles/common/issue_6.confluence similarity index 100% rename from src/test/suite/fixtures/testfiles/nix/issue_6.confluence rename to src/test/suite/fixtures/testfiles/common/issue_6.confluence diff --git a/src/test/suite/fixtures/testfiles/nix/issues.confluence b/src/test/suite/fixtures/testfiles/common/issues.confluence similarity index 100% rename from src/test/suite/fixtures/testfiles/nix/issues.confluence rename to src/test/suite/fixtures/testfiles/common/issues.confluence diff --git a/src/test/suite/fixtures/testfiles/nix/scoped/colortext.confluence b/src/test/suite/fixtures/testfiles/common/scoped/colortext.confluence similarity index 100% rename from src/test/suite/fixtures/testfiles/nix/scoped/colortext.confluence rename to src/test/suite/fixtures/testfiles/common/scoped/colortext.confluence diff --git a/src/test/suite/fixtures/testfiles/nix/scoped/headings.confluence b/src/test/suite/fixtures/testfiles/common/scoped/headings.confluence similarity index 100% rename from src/test/suite/fixtures/testfiles/nix/scoped/headings.confluence rename to src/test/suite/fixtures/testfiles/common/scoped/headings.confluence diff --git a/src/test/suite/fixtures/testfiles/nix/scoped/images.confluence b/src/test/suite/fixtures/testfiles/common/scoped/images.confluence similarity index 100% rename from src/test/suite/fixtures/testfiles/nix/scoped/images.confluence rename to src/test/suite/fixtures/testfiles/common/scoped/images.confluence diff --git a/src/test/suite/fixtures/testfiles/nix/scoped/links.confluence b/src/test/suite/fixtures/testfiles/common/scoped/links.confluence similarity index 100% rename from src/test/suite/fixtures/testfiles/nix/scoped/links.confluence rename to src/test/suite/fixtures/testfiles/common/scoped/links.confluence diff --git a/src/test/suite/fixtures/testfiles/nix/scoped/lists.confluence b/src/test/suite/fixtures/testfiles/common/scoped/lists.confluence similarity index 100% rename from src/test/suite/fixtures/testfiles/nix/scoped/lists.confluence rename to src/test/suite/fixtures/testfiles/common/scoped/lists.confluence diff --git a/src/test/suite/fixtures/testfiles/nix/scoped/tables.confluence b/src/test/suite/fixtures/testfiles/common/scoped/tables.confluence similarity index 100% rename from src/test/suite/fixtures/testfiles/nix/scoped/tables.confluence rename to src/test/suite/fixtures/testfiles/common/scoped/tables.confluence diff --git a/src/test/suite/fixtures/testfiles/nix/test.confluence b/src/test/suite/fixtures/testfiles/common/test.confluence similarity index 100% rename from src/test/suite/fixtures/testfiles/nix/test.confluence rename to src/test/suite/fixtures/testfiles/common/test.confluence diff --git a/src/test/suite/fixtures/testfiles/win/issue_41.confluence b/src/test/suite/fixtures/testfiles/win/issue_41.confluence deleted file mode 100644 index 2889ecb..0000000 --- a/src/test/suite/fixtures/testfiles/win/issue_41.confluence +++ /dev/null @@ -1,79 +0,0 @@ -h1. Issue [#41|https://github.com/denco/vscode-confluence-markup/issues/41] - macros: info,tip,note and warning - -h2. macro-info - -{info:title=This is info title} -This is Info information. -{info} -{info} -This is info without title information. -{info} -{info:title=Info with title w/o icon|icon=false} -This is Info information. -{info} -{info:icon=false} -INFO: titleless and iconless -{info} - - {info:title=This is my title|icon=false} -This is _important_ information. -{info} - -h2. macro-tip - -{tip:title=This is tip title} -This is Tip information. -{tip} -{tip} -This is tip without title information. -{tip} -{tip:title=Tip with title w/o icon|icon=false} -This is Tip information. -{tip} -{tip:icon=false} -TIP: titleless and iconless -{tip} - -h2. macro-note - -{note:title=This is note title} -This is note information. -{note} -{note} -This is note without title information. -{note} -{note:title=Note with title w/o icon|icon=false} -This is note information. -{note} -{note:icon=false} -NOTE: titleless and iconless -{note} - -h2. macro-warning - -{warning:title=This is warning title} -This is warning information. -{warning} -{warning} -This is warning without title information. -{warning} -{warning:title=This is warning title without icon|icon=false} -This is warning information. -{warning} -{warning:icon=false} -WARNING: titleless and iconless -{warning} - -h2. formatted panel - -{panel:title=My title|borderStyle=dashed|borderColor=YellowGreen|titleBGColor=#00a400|titleColor=white|bgColor=#72bc72} -A formatted panel -{panel} - -{panel:title=My title|borderStyle=solid|borderColor=Violet|titleBGColor=#00a400|titleColor=white|bgColor=#72bc72} -A formatted panel -{panel} - -{panel:title=My title|borderStyle=dotted|borderColor=red} -A formatted panel -{panel} diff --git a/src/test/suite/fixtures/testfiles/win/issue_44.confluence b/src/test/suite/fixtures/testfiles/win/issue_44.confluence deleted file mode 100644 index 3d95a79..0000000 --- a/src/test/suite/fixtures/testfiles/win/issue_44.confluence +++ /dev/null @@ -1,32 +0,0 @@ -h1. Issue [#44|https://github.com/denco/vscode-confluence-markup/issues/44] - lists with leading spaces - -h2. Case 1 - -- abc --- abcdef - -h2. Case 2 - -- abc - -- abcdef - -h2. Case 3 - -# abc -# def - #* foo - #** bar - -h2. Case 4 - -# abcv -# def - ** foo - *** bar - -h2. Case 5 - -# abc -# def - ## foo - ### bar diff --git a/src/test/suite/fixtures/testfiles/win/issue_6.confluence b/src/test/suite/fixtures/testfiles/win/issue_6.confluence deleted file mode 100644 index adc9ff2..0000000 --- a/src/test/suite/fixtures/testfiles/win/issue_6.confluence +++ /dev/null @@ -1,20 +0,0 @@ -h1. TITLE - -h2. Section One - -Section one. - -h2. Section Two - -Section two. - -# Numbered List 1 -# Numbered List 2 - -h2. Section Three - -Section three. - -h2. Section Four - -Section four. \ No newline at end of file diff --git a/src/test/suite/fixtures/testfiles/win/issues.confluence b/src/test/suite/fixtures/testfiles/win/issues.confluence deleted file mode 100644 index d4b153f..0000000 --- a/src/test/suite/fixtures/testfiles/win/issues.confluence +++ /dev/null @@ -1,127 +0,0 @@ -h1. *Issues* - -[#3|https://github.com/denco/vscode-confluence-markup/issues/3]: Noformat macro - -{noformat} -$ date -R -v+1d -Sat, 10 Feb 2018 10:37:39 +0100 -{noformat} - -[#5|https://github.com/denco/vscode-confluence-markup/issues/5]: Table without heading - -h4. Table without heading - -|test|test| -|simple table|two| - -[#6|https://github.com/denco/vscode-confluence-markup/issues/6]: Intenting - -h4. Header Four -- list one -- list two -- list three - -h4. next header (should not be indented) -* list -* list two - -h3. third header -- one -- two - -[#7|https://github.com/denco/vscode-confluence-markup/issues/7]: Nested lists - -* el. 1 -** el. 1.2. -** el. 1.3. -*** el. 1.3.1 -* el. 2 - -- el. 1 --- el. 1.2. --- el. 1.3. ---- el. 1.3.1 -- el. 2 - -# el. 1 -## el. 1.2. -## el. 1.3. -### el. 1.3.1 -# el. 2 - -[#8|https://github.com/denco/vscode-confluence-markup/issues/8]: -Dublicate of [#5|https://github.com/denco/vscode-confluence-markup/issues/5] - -[#17|https://github.com/denco/vscode-confluence-markup/issues/17]: Two or more monospace-formatted words - -This is a {{test}} of how things work with {{confluence}} markup. - -[#18|https://github.com/denco/vscode-confluence-markup/issues/18]: Italic text with dot in the end - -_Blah blah blah._ - -[#22|https://github.com/denco/vscode-confluence-markup/issues/22] panel support - -{panel} -Some text -{panel} - -{panel:title=My Title} -Some text with a title -{panel} - -{panel:title=My Title|borderStyle=dashed|borderColor=#ccc|titleBGColor=#F7D6C1|bgColor=#FFFFCE} -a block of text surrounded with a *panel* -yet _another_ line -{panel} - -[#24|https://github.com/denco/vscode-confluence-markup/issues/24]: Can't use [ and ] in string - -[lalala] - -[lalala\] - -[text|https://link] - -[text|https://link\] - -[ text|https://link ] - -[#28|https://github.com/denco/vscode-confluence-markup/issues/28]: Error by display of multiply links or escaped link markup in the same line. - -[first] [second] - -[first link|www.example.com] [second link|www.example.com] - -[first\] [second\] - -[#32|https://github.com/denco/vscode-confluence-markup/issues/32]: Support to {color:} - -{color:cyan}cyan{color} - -{color:rgb(222,150,212)}rgb(222,150,212){color} or {color:#12FFFE}hex#12FFFE{color} - -[#34|https://github.com/denco/vscode-confluence-markup/issues/34] - -{{h244000c8}} - -{{text}} - -h244000c8 - -{{monospace}} - -[#37|https://github.com/denco/vscode-confluence-markup/issues/37] move out of preview - -move out of preview, and bump to version: 1.0.0 - -[#38|https://github.com/denco/vscode-confluence-markup/issues/38] Preview is not working using links inside a table - -||heading 1||heading 2||heading 3 -|cell A1|cell A2|cell A3 -|cell B1|cell B2|cell B3 -|[example|www.example.com]|[google|www.google.com]|[vscode|https://code.visualstudio.com/] - -[#39|https://github.com/denco/vscode-confluence-markup/issues/39] Local image preview - -!../media/testing_cat.gif|width=500! diff --git a/src/test/suite/fixtures/testfiles/win/scoped/colortext.confluence b/src/test/suite/fixtures/testfiles/win/scoped/colortext.confluence deleted file mode 100644 index 1ba2439..0000000 --- a/src/test/suite/fixtures/testfiles/win/scoped/colortext.confluence +++ /dev/null @@ -1,8 +0,0 @@ -{color:red}look ma, red text!{color} -{color:blue}look ma, blue text!{color} -{color:green}look ma, green text!{color} - -{color:red}red{color}{color:yellow}yellow{color}{color:green}green{color} - -{color:rgb(202,200,100)}rgb(202,200,100){color} or {color:rgb(200,100,212)}rgb(12,200,112){color} -{color:#12FFFE}hex#12FFFE{color} or {color:#51F02E}hex#51F02E{color} \ No newline at end of file diff --git a/src/test/suite/fixtures/testfiles/win/scoped/headings.confluence b/src/test/suite/fixtures/testfiles/win/scoped/headings.confluence deleted file mode 100644 index a715ddd..0000000 --- a/src/test/suite/fixtures/testfiles/win/scoped/headings.confluence +++ /dev/null @@ -1,11 +0,0 @@ -h1. Heading 1 - -h2. Heading 2 - -h3. Heading 3 - -h4. Heading 4 - -h5. Heading 5 - -h6. Heading 6 diff --git a/src/test/suite/fixtures/testfiles/win/scoped/links.confluence b/src/test/suite/fixtures/testfiles/win/scoped/links.confluence deleted file mode 100644 index bfdebb9..0000000 --- a/src/test/suite/fixtures/testfiles/win/scoped/links.confluence +++ /dev/null @@ -1,23 +0,0 @@ -[simple_link] or [simple_link_other] - -[simple_link] or [escaped_link\] - -[escaped_link\] or [simple_link] - -[escaped_link\] or [escaped_link_other\] - -[www.example.com] or [www.web.com] - -[label|https://link] or [label_other|https://www.example.com] - -[textlink|https://link] or [escaped_link|https://link\] - -[ escaped_link_with_space|https://link1.com ] or [ escaped_link_with_space_other|https://link ] - -[simple_link] - -[text in square brackets\] - -[example.com|https://www.example.com] - -[example.com|https://www.example.com\] diff --git a/src/test/suite/fixtures/testfiles/win/scoped/lists.confluence b/src/test/suite/fixtures/testfiles/win/scoped/lists.confluence deleted file mode 100644 index 101e0c7..0000000 --- a/src/test/suite/fixtures/testfiles/win/scoped/lists.confluence +++ /dev/null @@ -1,95 +0,0 @@ -h1. Lists - -h2. Ordered - -h3. Simple - -# one -# two -# three -# four - -h3. Nested - -# one -# two -## nested one -## nested two -## nested three -### sub sub -### sub sub -#### sub s4 -##### sub s5 -###### sub s6 -####### sub s7 -# three - -h2. Unordered - -h3. Simple - -h4. "squared" - -- one -- two -- three -- four - -h4. "dotted" - -* one -* two -* three -* four - -h3. Nested - -h4. "squared" - -- one -- two --- nested one --- nested two --- nested three ---- sub sub ---- sub sub ----- sub s4 ------ sub s5 ------- sub s6 -------- sub s7 -- three - - -h4. "dotted" - -* one -* two -** nested one -** nested two -** nested three -*** sub sub -*** sub sub -**** sub s4 -***** sub s5 -****** sub s6 -******* sub s7 -* three - -h2. Mixed - -h3. Nested - -# one -# two -#- nested one -#- nested two -#- nested three -#-# sub sub -#-# sub sub -#--- sub s4 -#---# sub s5.1 -#---# sub s5.2 -#---#- sub s6 -#---#-# sub s7.1 -#---#-# sub s7.2 -# three diff --git a/src/test/suite/fixtures/testfiles/win/scoped/tables.confluence b/src/test/suite/fixtures/testfiles/win/scoped/tables.confluence deleted file mode 100644 index ff0328e..0000000 --- a/src/test/suite/fixtures/testfiles/win/scoped/tables.confluence +++ /dev/null @@ -1,29 +0,0 @@ -h1. Tables - -h2. Column heading - -||header c1||header c2|| -|data 1.1|data 1.2| -|data 2.1|data 2.2| - -h2. Row heading - -||header r1|data 1.1|data 1.2 -||header r2|data 2.1|data 2.2 -||header r3|data 3.1|data 3.2 - -h2. Column and row heading - -|| ||header c1||header c2 -||header r1|data 1.1|data 1.2| -||header r2|data 2.1|data 2.2| - -h2. Without heading - -|data 1.1|data 1.2| -|data 2.1|data 2.2| - -h2. Table with nested macros (not supported yet) - -||Heading 1||Heading 2|| -|* Item 1\\* Item 2\\* Item 3|# Item 1 \\# Item 2\\# Item 3| diff --git a/src/test/suite/fixtures/testfiles/win/test.confluence b/src/test/suite/fixtures/testfiles/win/test.confluence deleted file mode 100644 index 6c892aa..0000000 --- a/src/test/suite/fixtures/testfiles/win/test.confluence +++ /dev/null @@ -1,116 +0,0 @@ - -h1. *Examples* - ----- -h2. *headers:* - -h1. Header 1 -h2. Header 2 -h3. Header 3 -h4. Header 4 -h5. Header 5 -h6. Header 6 - ----- -h2. *emoticons:* - -* :) smile -* :( sad -* :P cheeky -* :D laugh -* ;) wink -* (y) thumbs-up -* (n) thumbs-down -* (i) information -* (/) tick -* (x) cross -* (!) warning - ----- -h2. *Links:* - -* [Mark Up|https://confluence.atlassian.com/doc/confluence-wiki-markup-251003035.html#ConfluenceWikiMarkup-Headings] -* [Storage Format|https://confluence.atlassian.com/doc/confluence-storage-format-790796544.html] -* [html format|https://www.w3schools.com/html/html_formatting.asp] -* [test|https://ifl2014.github.io/submissions/ifl2014_submission_18.pdf] - ----- -h2. *text effects:* - -*strong* - -*bold text* - -_emphasis_ - -_italics_ : Thing_x_ - -_italics with spaces_ - -??citation?? \\ - --deleted- \\ --deleted with spaces- \\ -+inserted+ \\ -Text with ^superscript^ : kg/m^3^ - -Text with ~subscript~ - -{{monospaced}} - -bq. Here's how you make a paragraph appear as a block quotation. - -{color:red}look ma, red text!{color} - ----- -h2. *lists:* - -Squared list -- one -- two - -Dotted list -* one -* tree -* third - -Numbered list -# one -#* borderStyle -#* dasddasd -# two -# :) - ----- -h2. *table:* - -||heading 1||heading 2||heading 3|| -|cell A1|cell A2|cell A3| -|cell B1|cell B2|cell B3| - - ----- -h2. *code:* - -{code:language=xml|title=test} - - - -{code} - -{code:language=sh|title=title|borderStyle=solid} -bash -echo very long command line with a lot of sings to check word wrap and how it looks like && echo much more elements to print -{code} - -{code}code oneline{code} - ----- -h2. *noformat:* - -{noformat} - - -{noformat} - -{noformat}noformat oneline{noformat} From 869b86068d39865e93ce0c611d038bc71b71be60 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Thu, 9 Nov 2023 16:23:44 +0100 Subject: [PATCH 03/32] render valid html --- src/extension.ts | 3 +- src/markupParser.ts | 222 +++++++++++++++++++++++--------------------- 2 files changed, 118 insertions(+), 107 deletions(-) diff --git a/src/extension.ts b/src/extension.ts index 04fe60f..d13c863 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -19,9 +19,8 @@ function getRenderedContent(contentProvider: ConfluenceContentProvider, uri: vsc const cssUrl = panel.webview.asWebviewUri(cssFile) cssLink = `` } - panel.webview.html = ` - + diff --git a/src/markupParser.ts b/src/markupParser.ts index 6def489..fc1b5e2 100644 --- a/src/markupParser.ts +++ b/src/markupParser.ts @@ -1,6 +1,5 @@ 'use strict'; -// The module 'vscode' contains the VS Code extensibility API -// Import the module and reference it with the alias vscode in your code below + import * as vscode from 'vscode'; import * as path from 'path'; @@ -8,6 +7,7 @@ const EXTENTION_ID = 'denco.confluence-markup'; const EMOTICON_PATH = '/media/emoticons/'; const CSS_PATH = '/media/css/'; const MONOSPACE_FONT_FAMILY = vscode.workspace.getConfiguration("confluenceMarkup").monospaceFont; +const LOCAL_FILE_OPTS = { scheme: 'https', authority: 'file+.vscode-resource.vscode-cdn.net' }; function imageUri(searchUri: vscode.Uri, imageLink: string) { let imageUri @@ -15,9 +15,9 @@ function imageUri(searchUri: vscode.Uri, imageLink: string) { imageUri = vscode.Uri.parse(imageLink); } else { if (path.isAbsolute(imageLink)) { - imageUri = vscode.Uri.file(imageLink).with({ scheme: 'vscode-resource' }); + imageUri = vscode.Uri.file(imageLink).with(LOCAL_FILE_OPTS); } else { - imageUri = vscode.Uri.file(path.join(path.dirname(searchUri.fsPath), imageLink)).with({ scheme: 'vscode-resource' }); + imageUri = vscode.Uri.file(path.join(path.dirname(searchUri.fsPath), imageLink)).with(LOCAL_FILE_OPTS); } } return imageUri; @@ -38,7 +38,7 @@ function getUri(filepath: string, filename: string) { function emoticonUri(emoticonFile: string) { const emoticonUrl = getUri(EMOTICON_PATH, emoticonFile) if (emoticonUrl) { - return emoticonUrl.with({scheme: 'vscode-resource'}); + return emoticonUrl.with(LOCAL_FILE_OPTS); } } @@ -58,19 +58,20 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { let listFlag = false; let listArr: string[] = []; - for (const entry of sourceText.split(/\r?\n/gi)) { - let tag = entry.replace(/^\s*/,''); //replace leading spaces + for (const entry of sourceText.split(/\r?\n|\r/gi)) { + let tag = entry.trim(); //remove leading and trailing spaces let html_tag = false; - if ((tag.length === 0 ) - && (! listFlag) - && (! tableFlag) - && (! codeTagFlag) - ) { + if ((tag.length === 0) + && (!listFlag) + && (!tableFlag) + && (!codeTagFlag) + ) { + result += '
'; continue; } - if (! codeTagFlag) { + if (!codeTagFlag) { tag = tag.replace(/h(\d+)\.\s([^\n]+)/g, "$2"); // tag = tag.replace(/_([^_]*)_/g, "$1"); @@ -85,45 +86,48 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { tag = tag.replace(/\{quote\}(.*)\{quote\}/g, "

$1

"); - tag = tag.replace(/:\)/g, '(smile)'); - tag = tag.replace(/:\(/g, '(sad)'); - tag = tag.replace(/:P/g, '(cheeky)'); - tag = tag.replace(/:D/g, '(laugh)'); - tag = tag.replace(/;\)/g, '(wink)'); - tag = tag.replace(/\(y\)/g, '(thumbs-up)'); - tag = tag.replace(/\(n\)/g, '(thumbs-down)'); - tag = tag.replace(/\(i\)/g, '(information)'); - tag = tag.replace(/\(\/\)/g, '(tick)'); - tag = tag.replace(/\(x\)/g, '(cross)'); - tag = tag.replace(/\(!\)/g, '(warning)'); + tag = tag.replace(/:\)/g, '(smile)'); + tag = tag.replace(/:\(/g, '(sad)'); + tag = tag.replace(/:P/g, '(cheeky)'); + tag = tag.replace(/:D/g, '(laugh)'); + tag = tag.replace(/;\)/g, '(wink)'); + tag = tag.replace(/\(y\)/g, '(thumbs-up)'); + tag = tag.replace(/\(n\)/g, '(thumbs-down)'); + tag = tag.replace(/\(i\)/g, '(information)'); + tag = tag.replace(/\(\/\)/g, '(tick)'); + tag = tag.replace(/\(x\)/g, '(cross)'); + tag = tag.replace(/\(!\)/g, '(warning)'); - tag = tag.replace(/\\\\/gi, '
'); + tag = tag.replace(/\\\\/gi, '
'); const re_href = /\[([^||\]]*)\|?([^[||]*)?\]/g if (tag.match(re_href)) { - tag = tag.replace(re_href, function (m0:string, m1:string, m2:string) { + tag = tag.replace(re_href, function (m0: string, m1: string, m2: string) { if (m1 !== undefined && (m1.startsWith(' ') || m1.endsWith('\\'))) { - return m0.replace(/\\/g,'').replace(/\|/g, '|') + return m0.replace(/\\/g, '').replace(/\|/g, '|') } if (m2 !== undefined && m2.endsWith('\\')) { - return m0.replace(/\\/g,'').replace(/\|/g, '|') + return m0.replace(/\\/g, '').replace(/\|/g, '|') } - if (m2 != undefined){ + if (m2 != undefined) { return "" + m1 + ""; } return "" + m1 + ""; }); html_tag = true; } + //img const img_re = /!([^|]*)\|?(.*)!/; const img_match = tag.match(img_re); if (img_match) { let imgAttr = "" - if (img_match[2].length != 0){ + if (img_match[2].length != 0) { imgAttr = img_match[2].replace(/=/gi, '="').replace(/,/gi, '" ') + '"' } - tag = ``; + const imageLink = imageUri(sourceUri, img_match[1]) + const imgAlt = imageLink.path.substring(imageLink.path.lastIndexOf('/') + 1); + tag = `${imgAlt}`; } //Table @@ -145,7 +149,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { tag = tag.replace(/\|/gi, ''); closeTableCell = ''; } - if (!tag.endsWith('') && !tag.endsWith('')){ + if (!tag.endsWith('') && !tag.endsWith('')) { tag += closeTableCell; } tag = '' + tag + ''; @@ -167,7 +171,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { const code_re = /\{(noformat|code)([^}]*)\}/; const code_match = tag.match(code_re); if (code_match) { - if (! codeTagFlag) { + if (!codeTagFlag) { let codeBlockStyle = ""; // Title style is unecessary for now. It can't be easily customized in Confluence. // let titleStyle = ""; @@ -175,14 +179,14 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { // let res = '
'
 					let res = `
`;
 					const splits = m2.split(/[|:]/);
-					splits.forEach( (el:string) => {
+					splits.forEach((el: string) => {
 						const elems = el.split('=');
-						if (elems[0] === "title"){
+						if (elems[0] === "title") {
 							res = `${elems[1]}${res}`;
 							// res = `${elems[1]}${res}`;
 						}
 						// Basic theme matching.
-						if (elems[0] === "theme"){
+						if (elems[0] === "theme") {
 							// Predefined confluence themes.
 							switch (elems[1].toLowerCase()) {
 								case "django":
@@ -203,17 +207,17 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) {
 								case "eclipse":
 								case "confluence":
 									codeBlockStyle = `;color:white;background-color:black;`;
-								}
+							}
 						}
 					});
-					res = `
${res}`; + res = `
${res.trim()}`; res = res.replace('$codeBlockStyle', codeBlockStyle); // res = res.replace('$titleStyle', titleStyle); return res; }); codeTagFlag = true; } else { - tag = '
'; + tag = '
'; //This pays attention to the list flag and adds the closing tag if needed. if (listFlag) { tag = `${tag}`; @@ -221,13 +225,14 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { codeTagFlag = false; } } - if (codeTagFlag && ! code_match) { - tag = tag.replace(/'; + if (codeTagFlag && !code_match) { + tag = tag.replace(/'; } const panel_re = /\{(panel|tip|info|note|warning)(.*)}/; - if (! codeTagFlag && tag.match(panel_re)) { - if (! panelTagFlag ) { + if (!codeTagFlag && tag.match(panel_re)) { + if (!panelTagFlag) { let panelStyle = ""; let titleStyle = ""; let iconlessFlag = ""; @@ -236,26 +241,26 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { let res = `
` const splits = m2.split(/[|:]/); - splits.forEach( (el:string) => { + splits.forEach((el: string) => { const elems = el.split('='); - if (elems[0] === "title"){ + if (elems[0] === "title") { res = `
${elems[1]}
${res}`; } - if (elems[0] === "titleBGColor"){ + if (elems[0] === "titleBGColor") { if (titleStyle.length === 0) { titleStyle = `style='background-color: ${elems[1]};`; } else { titleStyle += ` background-color: ${elems[1]};`; } } - if (elems[0] === "bgColor"){ + if (elems[0] === "bgColor") { if (panelStyle.length === 0) { panelStyle = `style='background-color: ${elems[1]};`; } else { panelStyle += ` background-color: ${elems[1]};`; } } - if (elems[0] === "borderStyle"){ + if (elems[0] === "borderStyle") { if (panelStyle.length === 0) { panelStyle = `style='border-style: ${elems[1]}; `; } else { @@ -267,7 +272,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { titleStyle += ` border-style: ${elems[1]}; border-bottom:none; `; } } - if (elems[0] === "borderColor"){ + if (elems[0] === "borderColor") { if (panelStyle.length === 0) { panelStyle = `style='border-color: ${elems[1]}; `; } else { @@ -279,7 +284,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { titleStyle += ` border-color: ${elems[1]}; `; } } - if (elems[0] === "borderWidth"){ + if (elems[0] === "borderWidth") { if (panelStyle.length === 0) { panelStyle = `style='border-width: ${elems[1]}; `; } else { @@ -291,7 +296,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { titleStyle += ` border-width: ${elems[1]}; `; } } - if (elems[0] === "icon" && elems[1] === "false"){ + if (elems[0] === "icon" && elems[1] === "false") { iconlessFlag = "-iconless"; } }); @@ -304,7 +309,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { if (panelClass != 'panel') { panelStyle = ""; titleStyle = ""; - if (!res.match(`${panelClass}-title`)){ + if (!res.match(`${panelClass}-title`)) { res = `
${res}`; } } @@ -325,67 +330,68 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { } // if (! codeTagFlag) { - // lists - const li_re = /^([-*#]+)\s(.*)/; - const li_match = tag.match(li_re); - if (li_match) { - listFlag = true; - listStyle = ''; - tag = ''; - if (li_match[1].match(/#$/)) { - listTag = 'ol'; - // reset ol after 3rd level - // add count of non-ol elements for mixed lists - if ((li_match[1].length + (li_match[1].match(/[-*]/g) || []).length) % 3 === 1) { - listStyle = ' class="initial"'; - } - } - if (li_match[1].match(/[-*]$/)) { - listTag = 'ul'; - } - if (li_match[1].match(/-$/)) { - listStyle = ' class="alternate"'; - } - if (li_match[1].length > listArr.length) { - tag = '<' + listTag + listStyle + '>'; - listArr.push(listTag); - } - if (li_match[1].length < listArr.length) { - tag = ''; - listArr = listArr.slice(0, li_match[1].length); - } - // This prevents the closing tag from being added too prematurely. - if (codeTagFlag || panelTagFlag) { - tag += "
  • " + li_match[2]; - } else { - tag += "
  • " + li_match[2] + "
  • "; + // lists + const li_re = /^([-*#]+)\s(.*)/; + const li_match = tag.match(li_re); + if (li_match) { + listFlag = true; + listStyle = ''; + tag = ''; + if (li_match[1].match(/#$/)) { + listTag = 'ol'; + // reset ol after 3rd level + // add count of non-ol elements for mixed lists + if ((li_match[1].length + (li_match[1].match(/[-*]/g) || []).length) % 3 === 1) { + listStyle = ' class="initial"'; } } + if (li_match[1].match(/[-*]$/)) { + listTag = 'ul'; + } + if (li_match[1].match(/-$/)) { + listStyle = ' class="alternate"'; + } + if (li_match[1].length > listArr.length) { + tag = '<' + listTag + listStyle + '>'; + listArr.push(listTag); + } + if (li_match[1].length < listArr.length) { + tag = ''; + listArr = listArr.slice(0, li_match[1].length); + } + // // This prevents the closing tag from being added too prematurely. + // if (codeTagFlag || panelTagFlag) { + tag += "
  • " + li_match[2]; + // } else { + // // tag += "
  • " + li_match[2] + "
  • "; + // tag += "
  • " + li_match[2]; + // } + } - if ((tag.length === 0) && (listArr.length > 0)) { - tag = ''; - tag = '' - listArr = []; - listFlag = false; - } + if ((tag.length === 0) && (listArr.length > 0)) { + tag = ''; + tag = '
  • ' + listArr = []; + listFlag = false; + } - if (!codeTagFlag && !listFlag) { + if (!codeTagFlag && !listFlag) { // hr and dash lines - tag = tag.replace(/-{4,}/gi, '
    '); + tag = tag.replace(/-{4,}/gi, '
    '); tag = tag.replace(/-{3}/gi, '—'); tag = tag.replace(/-{2}/gi, '–'); - } + } - // strong - tag = tag.replace(/\*([^*]*)\*/g, "$1"); - // line-through - if ((!html_tag) && (!tag.match('$1 "); - // tag = tag.replace(/_([^_]*)_/g, "$1"); - tag = tag.replace(/\B-((\([^)]*\)|{[^}]*}|\[[^]]+\]){0,3})(\S.*?\S|\S)-\B/g," $3 "); - tag = tag.replace(/(?:\b)_((\([^)]*\)|{[^}]*}|\[[^]]+\]){0,3})(\S.*?\S|\S)_(?:\b)/g, "$3"); - } + // strong + tag = tag.replace(/\*([^*]*)\*/g, "$1"); + // line-through + if ((!html_tag) && (!tag.match('$1 "); + // tag = tag.replace(/_([^_]*)_/g, "$1"); + tag = tag.replace(/\B-((\([^)]*\)|{[^}]*}|\[[^]]+\]){0,3})(\S.*?\S|\S)-\B/g, " $3 "); + tag = tag.replace(/(?:\b)_((\([^)]*\)|{[^}]*}|\[[^]]+\]){0,3})(\S.*?\S|\S)_(?:\b)/g, "$3"); + } // This only really applied to the inner part of code blocks and noformat blocks, so I moved it there and used a flag to trigger it. // } else { // if (tag !== `
    `) {
    @@ -398,7 +404,13 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) {
     			tag = '' + tag;
     			tableFlag = false;
     		}
    -		result += `

    ${tag}

    `; + + if (!tag.match(/<\/?code|<\/?pre>|<\/?table>|<\/?t[r|d|h]|<\/?li|<\/?ul|<\/?ol|<\/?div/) && !codeTagFlag) { + tag = `
    ${tag}
    `; + } else if (codeTagFlag && tag.indexOf('>') < 0) { + tag = tag + '\n'; + } + result += `${tag}`; } return result; From a7969343389e0cefe9e0bc09a7a54b26e20d6458 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Thu, 9 Nov 2023 16:26:46 +0100 Subject: [PATCH 04/32] test most used line endings: LF, CR and CRLF, use prettier for html beautify and validate --- .../suite/fixtures/expected/issue_41.html | 230 +++----- .../suite/fixtures/expected/issue_44.html | 154 ++--- src/test/suite/fixtures/expected/issue_6.html | 41 +- src/test/suite/fixtures/expected/issues.html | 502 +++++++--------- .../fixtures/expected/scoped/colortext.html | 37 +- .../fixtures/expected/scoped/headings.html | 24 +- .../fixtures/expected/scoped/images.html | 73 +-- .../suite/fixtures/expected/scoped/links.html | 55 +- .../suite/fixtures/expected/scoped/lists.html | 475 ++++++--------- .../fixtures/expected/scoped/tables.html | 219 +++---- src/test/suite/fixtures/expected/test.html | 547 +++++++----------- src/test/suite/markupParser.test.ts | 64 +- 12 files changed, 993 insertions(+), 1428 deletions(-) diff --git a/src/test/suite/fixtures/expected/issue_41.html b/src/test/suite/fixtures/expected/issue_41.html index 09f827b..f1ae2b6 100644 --- a/src/test/suite/fixtures/expected/issue_41.html +++ b/src/test/suite/fixtures/expected/issue_41.html @@ -1,179 +1,109 @@ -

    -

    Issue #41 - macros: info,tip,note and warning

    -

    -

    -

    macro-info

    -

    -

    +

    +

    + Issue + #41 + - macros: info,tip,note and warning +

    +
    +

    macro-info

    This is info title
    -
    -

    -

    This is Info information.

    -

    -

    -

    -

    +

    This is Info information.
    -

    -

    This is info without title information.

    -

    +

    This is info without title information.
    -

    -

    Info with title w/o icon
    -
    -

    -

    This is Info information.

    -

    -

    -

    -

    +

    This is Info information.
    -
    -

    -

    INFO: titleless and iconless

    -

    -

    -

    -

    +

    INFO: titleless and iconless
    This is my title
    -

    -

    This is important information.

    -

    +

    This is important information.
    -

    -

    -

    macro-tip

    -

    -

    +

    macro-tip

    This is tip title
    -
    -

    -

    This is Tip information.

    -

    -

    -

    -

    +

    This is Tip information.
    -

    -

    This is tip without title information.

    -

    +

    This is tip without title information.
    -

    -

    Tip with title w/o icon
    -
    -

    -

    This is Tip information.

    -

    -

    -

    -

    +

    This is Tip information.
    -
    -

    -

    TIP: titleless and iconless

    -

    -

    -

    -

    -

    macro-note

    -

    -

    +

    TIP: titleless and iconless
    +

    macro-note

    This is note title
    -
    -

    -

    This is note information.

    -

    -

    -

    -

    +

    This is note information.
    -

    -

    This is note without title information.

    -

    +

    This is note without title information.
    -

    -

    Note with title w/o icon
    -
    -

    -

    This is note information.

    -

    -

    -

    -

    +

    This is note information.
    -
    -

    -

    NOTE: titleless and iconless

    -

    -

    -

    -

    -

    macro-warning

    -

    -

    +

    NOTE: titleless and iconless
    +

    macro-warning

    This is warning title
    -
    -

    -

    This is warning information.

    -

    -

    -

    -

    +

    This is warning information.
    -

    -

    This is warning without title information.

    -

    +

    This is warning without title information.
    -

    -

    -

    This is warning title without icon
    -
    -

    -

    This is warning information.

    -

    +

    + This is warning title without icon
    -

    -

    +

    This is warning information.
    -

    -

    WARNING: titleless and iconless

    -

    -

    -

    -

    -

    formatted panel

    -

    -

    -

    My title -
    -
    -

    -

    A formatted panel

    -

    -

    -

    -

    -

    My title
    -
    -

    -

    A formatted panel

    -

    -

    -

    -

    -

    My title
    -
    -

    -

    A formatted panel

    -

    +

    WARNING: titleless and iconless
    +
    +

    formatted panel

    +
    + My title +
    +
    +
    A formatted panel
    +
    +
    + My title +
    +
    +
    A formatted panel
    +
    +
    + My title +
    +
    +
    A formatted panel
    -

    diff --git a/src/test/suite/fixtures/expected/issue_44.html b/src/test/suite/fixtures/expected/issue_44.html index 7e56052..5a53fb3 100644 --- a/src/test/suite/fixtures/expected/issue_44.html +++ b/src/test/suite/fixtures/expected/issue_44.html @@ -1,102 +1,72 @@ -

    -

    Issue #44 - lists with leading spaces

    -

    -

    -

    Case 1

    -

    -

    +

    +

    + Issue + #44 + - lists with leading spaces +

    +
    +

    Case 1

      -
    • abc
    • -

      -

      -

        -
      • abcdef
      • -

        -

        -

      +
    • + abc +
        +
      • abcdef
      • +
      +
    -

    -

    -

    Case 2

    -

    -

    +

    Case 2

      -
    • abc
    • -

      -

      -

        -
      • abcdef
      • -

        -

        -

      +
    • + abc +
        +
      • abcdef
      • +
      +
    -

    -

    -

    Case 3

    -

    -

    +

    Case 3

      -
    1. abc
    2. -

      -

      -

    3. def
    4. -

      -

      -

        -
      • foo
      • -

        -

        -

          -
        • bar
        • -

          -

          -

        -
      +
    5. abc
    6. +
    7. + def +
        +
      • + foo +
          +
        • bar
        • +
        +
      • +
      +
    -

    -

    -

    Case 4

    -

    -

    +

    Case 4

      -
    1. abcv
    2. -

      -

      -

    3. def
    4. -

      -

      -

        -
      • foo
      • -

        -

        -

          -
        • bar
        • -

          -

          -

        -
      +
    5. abcv
    6. +
    7. + def +
        +
      • + foo +
          +
        • bar
        • +
        +
      • +
      +
    -

    -

    -

    Case 5

    -

    -

    +

    Case 5

      -
    1. abc
    2. -

      -

      -

    3. def
    4. -

      -

      -

        -
      1. foo
      2. -

        -

        -

          -
        1. bar
        2. -

          -

          -

        -
      +
    5. abc
    6. +
    7. + def +
        +
      1. + foo +
          +
        1. bar
        2. +
        +
      2. +
      +
    -

    diff --git a/src/test/suite/fixtures/expected/issue_6.html b/src/test/suite/fixtures/expected/issue_6.html index d73951b..d88caa8 100644 --- a/src/test/suite/fixtures/expected/issue_6.html +++ b/src/test/suite/fixtures/expected/issue_6.html @@ -1,28 +1,13 @@ -

    -

    TITLE

    -

    -

    -

    Section One

    -

    -

    Section one.

    -

    -

    Section Two

    -

    -

    Section two.

    -

    -

      -
    1. Numbered List 1
    2. -

      -

      -

    3. Numbered List 2
    4. -

      -

    -

    -

    -

    Section Three

    -

    -

    Section three.

    -

    -

    Section Four

    -

    -

    Section four.

    \ No newline at end of file +

    TITLE

    +

    Section One

    +
    Section one.
    +

    Section Two

    +
    Section two.
    +
      +
    1. Numbered List 1
    2. +
    3. Numbered List 2
    4. +
    +

    Section Three

    +
    Section three.
    +

    Section Four

    +
    Section four.
    diff --git a/src/test/suite/fixtures/expected/issues.html b/src/test/suite/fixtures/expected/issues.html index 24299cd..87c6451 100644 --- a/src/test/suite/fixtures/expected/issues.html +++ b/src/test/suite/fixtures/expected/issues.html @@ -1,279 +1,223 @@ -

    -

    - Issues -

    -

    -

    - #3: Noformat macro

    -

    -

    -
    -			

    -

    $ date -R -v+1d -
    -

    -

    Sat, 10 Feb 2018 10:37:39 +0100 -
    -

    -

    - -
    -

    -

    - #5: Table without heading

    -

    -

    Table without heading

    -

    -

    - - - - - - -

    -

    -

    - - - -

    -

    -
    testtest
    simple tabletwo
    -

    -

    - #6: Intenting

    -

    -

    Header Four

    -

    -

    -

      -
    • list one
    • -

      -

      -

    • list two
    • -

      -

      -

    • list three
    • -

      -

    -

    -

    -

    next header (should not be indented)

    -

    -

    -

      -
    • list
    • -

      -

      -

    • list two
    • -

      -

    -

    -

    -

    third header

    -

    -

    -

      -
    • one
    • -

      -

      -

    • two
    • -

      -

    -

    -

    - #7: Nested lists

    -

    -

      -
    • el. 1
    • -

      -

      -

        -
      • el. 1.2.
      • -

        -

        -

      • el. 1.3.
      • -

        -

        -

          -
        • el. 1.3.1
        • -

          -

        -
      -
    • el. 2
    • -

      -

    -

    -

    -

      -
    • el. 1
    • -

      -

      -

        -
      • el. 1.2.
      • -

        -

        -

      • el. 1.3.
      • -

        -

        -

          -
        • el. 1.3.1
        • -

          -

        -
      -
    • el. 2
    • -

      -

    -

    -

    -

      -
    1. el. 1
    2. -

      -

      -

        -
      1. el. 1.2.
      2. -

        -

        -

      3. el. 1.3.
      4. -

        -

        -

          -
        1. el. 1.3.1
        2. -

          -

        -
      -
    3. el. 2
    4. -

      -

    -

    -

    - #8:

    -

    Dublicate of - #5 -

    -

    - #17: Two or more monospace-formatted words

    -

    This is a - testof how things work with - confluencemarkup.

    -

    - #18: Italic text with dot in the end

    -

    - Blah blah blah. -

    -

    - #22panel support

    -

    -

    -

    Some text

    -

    -

    -

    -

    My Title
    -

    -

    Some text with a title

    -

    -

    -

    -

    My Title
    -

    -

    a block of text surrounded with a - panel -

    -

    yet - anotherline

    -

    -

    -

    - #24: Can't use [ and ] in string

    -

    - lalala -

    -

    [lalala]

    -

    - text -

    -

    [text|https://link]

    -

    [ text|https://link ]

    -

    - #28: Error by display of multiply links or escaped link markup in the same line.

    -

    - first - second -

    -

    - first link - second link -

    -

    [first] [second]

    -

    - #32: Support to {color:}

    -

    - cyan -

    -

    - rgb(222,150,212)or - hex#12FFFE -

    -

    - #34 -

    -

    - h244000c8 -

    -

    - text -

    -

    h244000c8

    -

    - monospace -

    -

    - #37move out of preview

    -

    move out of preview, and bump to version: 1.0.0

    -

    - #38Preview is not working using links inside a table

    -

    - - - - - - - -

    -

    -

    - - - - -

    -

    -

    - - - - -

    -

    -

    - - - - -

    -

    -
    heading 1heading 2heading 3
    cell A1cell A2cell A3
    cell B1cell B2cell B3
    - example - - google - - vscode -
    -

    -

    - #39Local image preview

    -

    -

    \ No newline at end of file +
    +

    Issues

    +
    +
    + #3: + Noformat macro +
    +
    +
    $ date -R -v+1d
    +Sat, 10 Feb 2018 10:37:39 +0100
    +
    +
    +
    + #5: + Table without heading +
    +

    Table without heading

    + + + + + + + + + + + +
    testtest
    simple tabletwo
    +
    + #6: + Intenting +
    +

    Header Four

    +
      +
    • list one
    • +
    • list two
    • +
    • list three
    • +
    +

    next header (should not be indented)

    +
      +
    • list
    • +
    • list two
    • +
    +

    third header

    +
      +
    • one
    • +
    • two
    • +
    +
    + #7: + Nested lists +
    +
      +
    • + el. 1 +
        +
      • el. 1.2.
      • +
      • + el. 1.3. +
          +
        • el. 1.3.1
        • +
        +
      • +
      +
    • +
    • el. 2
    • +
    +
      +
    • + el. 1 +
        +
      • el. 1.2.
      • +
      • + el. 1.3. +
          +
        • el. 1.3.1
        • +
        +
      • +
      +
    • +
    • el. 2
    • +
    +
      +
    1. + el. 1 +
        +
      1. el. 1.2.
      2. +
      3. + el. 1.3. +
          +
        1. el. 1.3.1
        2. +
        +
      4. +
      +
    2. +
    3. el. 2
    4. +
    +
    + #8: +
    +
    + Dublicate of + #5 +
    +
    + #17: + Two or more monospace-formatted words +
    +This is a +test of how +things work with +confluence +markup. +
    + #18: + Italic text with dot in the end +
    +
    Blah blah blah.
    +
    + #22 + panel support +
    +
    Some text
    +
    My Title
    +
    Some text with a title
    +
    + My Title +
    +
    +
    a block of text surrounded with a panel
    +
    yet another line
    +
    +
    + #24: + Can't use [ and ] in string +
    + +
    [lalala]
    + +
    [text|https://link]
    +
    [ text|https://link ]
    +
    + #28: + Error by display of multiply links or escaped link markup in the same line. +
    + + +
    [first] [second]
    +
    + #32: + Support to {color:} +
    +
    cyan
    +
    + rgb(222,150,212) or + hex#12FFFE +
    +
    + #34 +
    +h244000c8text +
    h244000c8
    +monospace +
    + #37 + move out of preview +
    +
    move out of preview, and bump to version: 1.0.0
    +
    + #38 + Preview is not working using links inside a table +
    + + + + + + + + + + + + + + + + + + + + + + + +
    heading 1heading 2heading 3
    cell A1cell A2cell A3
    cell B1cell B2cell B3
    examplegooglevscode
    +
    + #39 + Local image preview +
    +
    + testing_cat.gif +
    diff --git a/src/test/suite/fixtures/expected/scoped/colortext.html b/src/test/suite/fixtures/expected/scoped/colortext.html index 90a2677..1ee90f5 100644 --- a/src/test/suite/fixtures/expected/scoped/colortext.html +++ b/src/test/suite/fixtures/expected/scoped/colortext.html @@ -1,22 +1,15 @@ -

    - look ma, red text! -

    -

    - look ma, blue text! -

    -

    - look ma, green text! -

    -

    - red - yellow - green -

    -

    - rgb(202,200,100)or - rgb(12,200,112) -

    -

    - hex#12FFFEor - hex#51F02E -

    \ No newline at end of file +
    look ma, red text!
    +
    look ma, blue text!
    +
    look ma, green text!
    +
    + redyellowgreen +
    +
    + rgb(202,200,100) or + rgb(12,200,112) +
    +
    + hex#12FFFE or + hex#51F02E +
    diff --git a/src/test/suite/fixtures/expected/scoped/headings.html b/src/test/suite/fixtures/expected/scoped/headings.html index 4a156c0..4c6a83d 100644 --- a/src/test/suite/fixtures/expected/scoped/headings.html +++ b/src/test/suite/fixtures/expected/scoped/headings.html @@ -1,18 +1,6 @@ -

    -

    Heading 1

    -

    -

    -

    Heading 2

    -

    -

    -

    Heading 3

    -

    -

    -

    Heading 4

    -

    -

    -

    Heading 5
    -

    -

    -

    Heading 6
    -

    \ No newline at end of file +

    Heading 1

    +

    Heading 2

    +

    Heading 3

    +

    Heading 4

    +
    Heading 5
    +
    Heading 6
    diff --git a/src/test/suite/fixtures/expected/scoped/images.html b/src/test/suite/fixtures/expected/scoped/images.html index a11e2c2..e632d24 100644 --- a/src/test/suite/fixtures/expected/scoped/images.html +++ b/src/test/suite/fixtures/expected/scoped/images.html @@ -1,36 +1,37 @@ -

    -

    cats

    -

    -

    -

      -
    • - coding cat -
    • -

      -

      - -

      -

    -

    -

    -

      -
    • - compiling cat -
    • -

      -

      - -

      -

    -

    -

    -

      -
    • - testing cat -
    • -

      -

      - -

      -

    -

    \ No newline at end of file +

    cats

    +
      +
    • + coding cat +
      + giphy.gif +
      +
    • +
    +
      +
    • + compiling cat +
      + giphy.gif +
      +
    • +
    +
      +
    • + testing cat +
      + testing_cat.gif +
      +
    • +
    diff --git a/src/test/suite/fixtures/expected/scoped/links.html b/src/test/suite/fixtures/expected/scoped/links.html index 492c482..ec608e6 100644 --- a/src/test/suite/fixtures/expected/scoped/links.html +++ b/src/test/suite/fixtures/expected/scoped/links.html @@ -1,29 +1,26 @@ -

    - simple_linkor - simple_link_other -

    -

    - simple_linkor [escaped_link]

    -

    [escaped_link] or - simple_link -

    -

    [escaped_link] or [escaped_link_other]

    -

    - www.example.comor - www.web.com -

    -

    - labelor - label_other -

    -

    - textlinkor [escaped_link|https://link]

    -

    [ escaped_link_with_space|https://link1.com ] or [ escaped_link_with_space_other|https://link ]

    -

    - simple_link -

    -

    [text in square brackets]

    -

    - example.com -

    -

    [example.com|https://www.example.com]

    \ No newline at end of file + +
    simple_link or [escaped_link]
    +
    [escaped_link] or simple_link
    +
    [escaped_link] or [escaped_link_other]
    + +
    + label or + label_other +
    +
    + textlink or [escaped_link|https://link] +
    +
    + [ escaped_link_with_space|https://link1.com ] or [ + escaped_link_with_space_other|https://link ] +
    + +
    [text in square brackets]
    + +
    [example.com|https://www.example.com]
    diff --git a/src/test/suite/fixtures/expected/scoped/lists.html b/src/test/suite/fixtures/expected/scoped/lists.html index a38d77c..075a1dd 100644 --- a/src/test/suite/fixtures/expected/scoped/lists.html +++ b/src/test/suite/fixtures/expected/scoped/lists.html @@ -1,290 +1,185 @@ -

    -

    Lists

    -

    -

    -

    Ordered

    -

    -

    -

    Simple

    -

    -

    -

      -
    1. one
    2. -

      -

      -

    3. two
    4. -

      -

      -

    5. three
    6. -

      -

      -

    7. four
    8. -

      -

    -

    -

    -

    Nested

    -

    -

    -

      -
    1. one
    2. -

      -

      -

    3. two
    4. -

      -

      -

        -
      1. nested one
      2. -

        -

        -

      3. nested two
      4. -

        -

        -

      5. nested three
      6. -

        -

        -

          -
        1. sub sub
        2. -

          -

          -

        3. sub sub
        4. -

          -

          -

            -
          1. sub s4
          2. -

            -

            -

              -
            1. sub s5
            2. -

              -

              -

                -
              1. sub s6
              2. -

                -

                -

                  -
                1. sub s7
                2. -

                  -

                -
              -
            -
          -
        -
      -
    5. three
    6. -

      -

    -

    -

    -

    Unordered

    -

    -

    -

    Simple

    -

    -

    -

    "squared"

    -

    -

    -

      -
    • one
    • -

      -

      -

    • two
    • -

      -

      -

    • three
    • -

      -

      -

    • four
    • -

      -

    -

    -

    -

    "dotted"

    -

    -

    -

      -
    • one
    • -

      -

      -

    • two
    • -

      -

      -

    • three
    • -

      -

      -

    • four
    • -

      -

    -

    -

    -

    Nested

    -

    -

    -

    "squared"

    -

    -

    -

      -
    • one
    • -

      -

      -

    • two
    • -

      -

      -

        -
      • nested one
      • -

        -

        -

      • nested two
      • -

        -

        -

      • nested three
      • -

        -

        -

          -
        • sub sub
        • -

          -

          -

        • sub sub
        • -

          -

          -

            -
          • sub s4
          • -

            -

            -

              -
            • sub s5
            • -

              -

              -

                -
              • sub s6
              • -

                -

                -

                  -
                • sub s7
                • -

                  -

                -
              -
            -
          -
        -
      -
    • three
    • -

      -

    -

    -

    -

    "dotted"

    -

    -

    -

      -
    • one
    • -

      -

      -

    • two
    • -

      -

      -

        -
      • nested one
      • -

        -

        -

      • nested two
      • -

        -

        -

      • nested three
      • -

        -

        -

          -
        • sub sub
        • -

          -

          -

        • sub sub
        • -

          -

          -

            -
          • sub s4
          • -

            -

            -

              -
            • sub s5
            • -

              -

              -

                -
              • sub s6
              • -

                -

                -

                  -
                • sub s7
                • -

                  -

                -
              -
            -
          -
        -
      -
    • three
    • -

      -

    -

    -

    -

    Mixed

    -

    -

    -

    Nested

    -

    -

    -

      -
    1. one
    2. -

      -

      -

    3. two
    4. -

      -

      -

        -
      • nested one
      • -

        -

        -

      • nested two
      • -

        -

        -

      • nested three
      • -

        -

        -

          -
        1. sub sub
        2. -

          -

          -

        3. sub sub
        4. -

          -

          -

            -
          • sub s4
          • -

            -

            -

              -
            1. sub s5.1
            2. -

              -

              -

            3. sub s5.2
            4. -

              -

              -

                -
              • sub s6
              • -

                -

                -

                  -
                1. sub s7.1
                2. -

                  -

                  -

                3. sub s7.2
                4. -

                  -

                -
              -
            -
          -
        -
      -
    5. three
    6. -

      -

    -

    \ No newline at end of file +

    Lists

    +

    Ordered

    +

    Simple

    +
      +
    1. one
    2. +
    3. two
    4. +
    5. three
    6. +
    7. four
    8. +
    +

    Nested

    +
      +
    1. one
    2. +
    3. + two +
        +
      1. nested one
      2. +
      3. nested two
      4. +
      5. + nested three +
          +
        1. sub sub
        2. +
        3. + sub sub +
            +
          1. + sub s4 +
              +
            1. + sub s5 +
                +
              1. + sub s6 +
                  +
                1. sub s7
                2. +
                +
              2. +
              +
            2. +
            +
          2. +
          +
        4. +
        +
      6. +
      +
    4. +
    5. three
    6. +
    +

    Unordered

    +

    Simple

    +

    "squared"

    +
      +
    • one
    • +
    • two
    • +
    • three
    • +
    • four
    • +
    +

    "dotted"

    +
      +
    • one
    • +
    • two
    • +
    • three
    • +
    • four
    • +
    +

    Nested

    +

    "squared"

    +
      +
    • one
    • +
    • + two +
        +
      • nested one
      • +
      • nested two
      • +
      • + nested three +
          +
        • sub sub
        • +
        • + sub sub +
            +
          • + sub s4 +
              +
            • + sub s5 +
                +
              • + sub s6 +
                  +
                • sub s7
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • three
    • +
    +

    "dotted"

    +
      +
    • one
    • +
    • + two +
        +
      • nested one
      • +
      • nested two
      • +
      • + nested three +
          +
        • sub sub
        • +
        • + sub sub +
            +
          • + sub s4 +
              +
            • + sub s5 +
                +
              • + sub s6 +
                  +
                • sub s7
                • +
                +
              • +
              +
            • +
            +
          • +
          +
        • +
        +
      • +
      +
    • +
    • three
    • +
    +

    Mixed

    +

    Nested

    +
      +
    1. one
    2. +
    3. + two +
        +
      • nested one
      • +
      • nested two
      • +
      • + nested three +
          +
        1. sub sub
        2. +
        3. + sub sub +
            +
          • + sub s4 +
              +
            1. sub s5.1
            2. +
            3. + sub s5.2 +
                +
              • + sub s6 +
                  +
                1. sub s7.1
                2. +
                3. sub s7.2
                4. +
                +
              • +
              +
            4. +
            +
          • +
          +
        4. +
        +
      • +
      +
    4. +
    5. three
    6. +
    diff --git a/src/test/suite/fixtures/expected/scoped/tables.html b/src/test/suite/fixtures/expected/scoped/tables.html index 91e4a5c..b00ac32 100644 --- a/src/test/suite/fixtures/expected/scoped/tables.html +++ b/src/test/suite/fixtures/expected/scoped/tables.html @@ -1,133 +1,86 @@ -

    -

    Tables

    -

    -

    -

    Column heading

    -

    -

    - - - - - - -

    -

    -

    - - - -

    -

    -

    - - - -

    -

    -
    header c1header c2
    data 1.1data 1.2
    data 2.1data 2.2
    -

    -

    -

    Row heading

    -

    -

    - - - - - - - -

    -

    -

    - - - - -

    -

    -

    - - - - -

    -

    -
    header r1data 1.1data 1.2
    header r2data 2.1data 2.2
    header r3data 3.1data 3.2
    -

    -

    -

    Column and row heading

    -

    -

    - - - - - - - -

    -

    -

    - - - - -

    -

    -

    - - - - -

    -

    -
    header c1header c2
    header r1data 1.1data 1.2
    header r2data 2.1data 2.2
    -

    -

    -

    Without heading

    -

    -

    - - - - - - -

    -

    -

    - - - -

    -

    -
    data 1.1data 1.2
    data 2.1data 2.2
    -

    -

    -

    Table with nested macros (not supported yet)

    -

    -

    - - - - - - -

    -

    -

    - - - -

    -

    -
    Heading 1Heading 2
    - Item 1 -
    -
    Item 2 -
    * Item 3
    # Item 1 -
    # Item 2 -
    # Item 3
    -

    \ No newline at end of file +

    Tables

    +

    Column heading

    + + + + + + + + + + + + + + + +
    header c1header c2
    data 1.1data 1.2
    data 2.1data 2.2
    +

    Row heading

    + + + + + + + + + + + + + + + + + + +
    header r1data 1.1data 1.2
    header r2data 2.1data 2.2
    header r3data 3.1data 3.2
    +

    Column and row heading

    + + + + + + + + + + + + + + + + + + +
    header c1header c2
    header r1data 1.1data 1.2
    header r2data 2.1data 2.2
    +

    Without heading

    + + + + + + + + + + + +
    data 1.1data 1.2
    data 2.1data 2.2
    +

    Table with nested macros (not supported yet)

    + + + + + + + + + + + +
    Heading 1Heading 2
    + Item 1
    Item 2
    * Item 3 +
    # Item 1
    # Item 2
    # Item 3
    diff --git a/src/test/suite/fixtures/expected/test.html b/src/test/suite/fixtures/expected/test.html index aa75efc..5ee8373 100644 --- a/src/test/suite/fixtures/expected/test.html +++ b/src/test/suite/fixtures/expected/test.html @@ -1,323 +1,224 @@ -

    -

    - Examples -

    -

    -

    -


    -

    -

    - headers: -

    -

    -

    -

    Header 1

    -

    -

    -

    Header 2

    -

    -

    -

    Header 3

    -

    -

    -

    Header 4

    -

    -

    -

    Header 5
    -

    -

    -

    Header 6
    -

    -

    -


    -

    -

    - emoticons: -

    -

    -

    -

      -
    • - (smile)smile
    • -

      -

      -

    • - (sad)sad
    • -

      -

      -

    • - (cheeky)cheeky
    • -

      -

      -

    • - (laugh)laugh
    • -

      -

      -

    • - (wink)wink
    • -

      -

      -

    • - (thumbs-up)thumbs-up
    • -

      -

      -

    • - (thumbs-down)thumbs-down
    • -

      -

      -

    • - (information)information
    • -

      -

      -

    • - (tick)tick
    • -

      -

      -

    • - (cross)cross
    • -

      -

      -

    • - (warning)warning
    • -

      -

    -

    -

    -


    -

    -

    - Links: -

    -

    -

    -

    -

    -

    -


    -

    -

    - text effects: -

    -

    -

    - strong -

    -

    - bold text -

    -

    - emphasis -

    -

    - italics: Thing_x_ -

    -

    - italics with spaces -

    -

    - citation -

    -

    - deleted -

    -

    - deleted with spaces -

    -

    - inserted -

    -

    Text with - superscript: kg/m - 3 -

    -

    Text with - subscript -

    -

    - monospaced -

    -

    -

    -

    Here's how you make a paragraph appear as a block quotation.

    -
    -

    -

    - look ma, red text! -

    -

    -


    -

    -

    - lists: -

    -

    -

    Squared list

    -

    -

      -
    • one
    • -

      -

      -

    • two
    • -

      -

    -

    -

    Dotted list

    -

    -

      -
    • one
    • -

      -

      -

    • tree
    • -

      -

      -

    • third
    • -

      -

    -

    -

    Numbered list

    -

    -

      -
    1. one
    2. -

      -

      -

        -
      • borderStyle
      • -

        -

        -

      • dasddasd
      • -

        -

      -
    3. two
    4. -

      -

      -

    5. - (smile) -
    6. -

      -

    -

    -

    -


    -

    -

    - table: -

    -

    -

    - - - - - - - -

    -

    -

    - - - - -

    -

    -

    - - - - -

    -

    -

    -
    heading 1heading 2heading 3
    cell A1cell A2cell A3
    cell B1cell B2cell B3
    -

    -

    -


    -

    -

    - code: -

    -

    -

    -

    - test -
    -			

    -

    <test> -
    -

    -

    <test1 /> -
    -

    -

    </test> -
    -

    -

    - -
    -

    -

    -

    - title -
    -			

    -

    bash -
    -

    -

    echo very long command line with a lot of sings to check word wrap and how it looks like && echo much more elements to print -
    -

    -

    - -
    -

    -

    -

    -		code oneline
    -	
    -

    -

    -


    -

    -

    - noformat: -

    -

    -

    -

    -
    -			

    -

    <xml> -
    -

    -

    </xml> -
    -

    -

    - -
    -

    -

    -

    -		noformat <tag></tag>oneline
    -	
    -

    \ No newline at end of file +
    +

    Examples

    +
    +

    +
    +

    headers:

    +
    +

    Header 1

    +

    Header 2

    +

    Header 3

    +

    Header 4

    +
    Header 5
    +
    Header 6
    +

    +
    +

    emoticons:

    +
    +
      +
    • + (smile) + smile +
    • +
    • + (sad) + sad +
    • +
    • + (cheeky) + cheeky +
    • +
    • + (laugh) + laugh +
    • +
    • + (wink) + wink +
    • +
    • + (thumbs-up) + thumbs-up +
    • +
    • + (thumbs-down) + thumbs-down +
    • +
    • + (information) + information +
    • +
    • + (tick) + tick +
    • +
    • + (cross) + cross +
    • +
    • + (warning) + warning +
    • +
    +

    +
    +

    Links:

    +
    + +

    +
    +

    text effects:

    +
    +
    strong
    +
    bold text
    +
    emphasis
    +
    italics : Thing_x_
    +
    italics with spaces
    +
    citation
    +
    deleted
    +
    + deleted with spaces
    +
    +
    inserted
    +
    Text with superscript : kg/m3
    +
    Text with subscript
    +monospaced +
    +
    +

    Here's how you make a paragraph appear as a block quotation.

    +
    +
    +
    look ma, red text!
    +

    +
    +

    lists:

    +
    +
    Squared list
    +
      +
    • one
    • +
    • two
    • +
    +
    Dotted list
    +
      +
    • one
    • +
    • tree
    • +
    • third
    • +
    +
    Numbered list
    +
      +
    1. + one +
        +
      • borderStyle
      • +
      • dasddasd
      • +
      +
    2. +
    3. two
    4. +
    5. + (smile) +
    6. +
    +

    +
    +

    table:

    +
    + + + + + + + + + + + + + + + + + + +
    heading 1heading 2heading 3
    cell A1cell A2cell A3
    cell B1cell B2cell B3
    +

    +
    +

    code:

    +
    +
    + test +
    <test><test1 /></test>
    +
    +
    + title +
    bash
    +echo very long command line with a lot of sings to check word wrap and how it looks like && echo much more elements to print
    +
    +
    +
    code oneline
    +

    +
    +

    noformat:

    +
    +
    +
    <xml></xml>
    +
    +
    noformat <tag></tag> oneline
    diff --git a/src/test/suite/markupParser.test.ts b/src/test/suite/markupParser.test.ts index e302395..7578cee 100644 --- a/src/test/suite/markupParser.test.ts +++ b/src/test/suite/markupParser.test.ts @@ -5,8 +5,7 @@ import * as vscode from 'vscode'; import * as path from 'path'; import { parseMarkup, cssUri } from '../../markupParser'; import * as fs from 'fs'; - -const HTML_FORMATTER = require('html-formatter'); // eslint-disable-line @typescript-eslint/no-var-requires +import * as prettier from "@prettier/sync"; const FILE_ENCODING = 'utf8'; @@ -17,6 +16,7 @@ const PROJECT_ROOT_DIR = path.join(__dirname, '../../..'); const TEST_EXTENSION_PATH_PLACEHOLDER = '_TEST_EXTENSION_PATH_PLACEHOLDER_'; const TEST_FILES_ROOT = path.join(PROJECT_ROOT_DIR, "/src/test/suite/fixtures/testfiles"); const FIXTURES_ROOT = path.join(PROJECT_ROOT_DIR, "/src/test/suite/fixtures/expected"); +const TEST_EXTENSION_PATH_PLACEHOLDER_REPLACE_PREFIX = 'https://file%2B.vscode-resource.vscode-cdn.net'; function walkdirSync(dir: string): string[] { return fs.readdirSync(dir).reduce(function (result: string[], file) { @@ -46,38 +46,46 @@ suite("MarkupParser Tests", function () { } }); - walkdirSync(TEST_FILES_ROOT).filter(isConfluence).forEach(fullFilePath => { - const fileName = path.basename(fullFilePath); - const dirName = path.dirname(fullFilePath); - - let typeDir = path.basename(dirName); - let scopedDir = '' - if (dirName.endsWith('scoped')) { - scopedDir = path.basename(dirName); - typeDir = path.basename(path.dirname(dirName)); - } + const eolMap = new Map(); + eolMap.set("LF", "\n"); + eolMap.set("CR", "\r"); + eolMap.set("CRLF", "\r\n"); - const testName = "Render testfile: " + path.join(typeDir, scopedDir, fileName) - test(testName, function () { - const fixtureFile = path.join(FIXTURES_ROOT, scopedDir, fileName.replace(CONFLUENCE_FILENAME_EXTENSION, HTML_FILENAME_EXTENSION)); + for (const eolMapKey of eolMap.keys()) { - let project_root_dir = PROJECT_ROOT_DIR; + walkdirSync(TEST_FILES_ROOT).filter(isConfluence).forEach(fullFilePath => { + const fileName = path.basename(fullFilePath); + const dirName = path.dirname(fullFilePath); - if (process.platform === 'win32') { - project_root_dir = `/${project_root_dir.split(path.sep).join(path.posix.sep).replace(':', '%3A')}`; + let typeDir = path.basename(dirName); + let scopedDir = '' + if (dirName.endsWith('scoped')) { + scopedDir = path.basename(dirName); + typeDir = path.basename(path.dirname(dirName)); } - const fixtureContent = HTML_FORMATTER.render( - fs.readFileSync(fixtureFile, FILE_ENCODING).replace(new RegExp(TEST_EXTENSION_PATH_PLACEHOLDER, 'g'), project_root_dir) - ); + const testName = `Render testfile: ${path.join(typeDir, scopedDir, fileName)} with EOL: ${eolMapKey}` + test(testName, function () { + const fixtureFile = path.join(FIXTURES_ROOT, scopedDir, fileName.replace(CONFLUENCE_FILENAME_EXTENSION, HTML_FILENAME_EXTENSION)); - const testFileUri = vscode.Uri.file(fullFilePath); - const confluenceContent = fs.readFileSync(testFileUri.fsPath, FILE_ENCODING); + let project_root_dir = PROJECT_ROOT_DIR; + if (process.platform === 'win32') { + project_root_dir = `${project_root_dir.split(path.sep).join(path.posix.sep).replace(':', '%3A')}`; + } - const parsedMarkup = HTML_FORMATTER.render( - parseMarkup(testFileUri, confluenceContent) - ); - assert.strictEqual(parsedMarkup, fixtureContent); + const expectedContent = prettier.format( + fs.readFileSync(fixtureFile, FILE_ENCODING).replace(new RegExp(TEST_EXTENSION_PATH_PLACEHOLDER, 'g'), `${TEST_EXTENSION_PATH_PLACEHOLDER_REPLACE_PREFIX}/${project_root_dir}`), + { parser: "html" } + ); + + const testFileUri = vscode.Uri.file(fullFilePath); + const confluenceContent = fs.readFileSync(testFileUri.fsPath, FILE_ENCODING).replace(/\n/g, eolMap.get(eolMapKey)); + + // const rawRenderedHtml = `${testName}${parseMarkup(testFileUri, confluenceContent)}`; + const rawRenderedHtml = parseMarkup(testFileUri, confluenceContent); + const formattedContent = prettier.format(rawRenderedHtml, { parser: "html" }); + assert.strictEqual(expectedContent, formattedContent); + }); }); - }); + } }); From 2450b14b05723edcdac30c181ea809780d0fb67d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Thu, 9 Nov 2023 16:27:23 +0100 Subject: [PATCH 05/32] format css --- media/css/confluence.css | 90 +++++++++++++++++++++++++++++----------- 1 file changed, 66 insertions(+), 24 deletions(-) diff --git a/media/css/confluence.css b/media/css/confluence.css index 0a08f41..737ae44 100644 --- a/media/css/confluence.css +++ b/media/css/confluence.css @@ -14,7 +14,11 @@ a { color: #4080D0; text-decoration: none; } -a:focus, input:focus, select:focus, textarea:focus { + +a:focus, +input:focus, +select:focus, +textarea:focus { outline: 1px solid -webkit-focus-ring-color; outline-offset: -1px; } @@ -32,7 +36,9 @@ h1 { border-bottom-style: solid; } -h1, h2, h3 { +h1, +h2, +h3 { font-weight: normal; } @@ -41,7 +47,9 @@ blockquote { border-left: 5px solid; } -table, th, td { +table, +th, +td { border: 1px solid; border-collapse: collapse; padding: 7px; @@ -55,7 +63,7 @@ table, th, td { .code-title { display: block; - background:#c6c3c3; + background: #c6c3c3; color: black; font-weight: bold; border-bottom-color: #ccc; @@ -68,9 +76,9 @@ pre { margin: 0px; } -pre > code { +pre>code { display: block; - background:rgba(0, 0, 0, 0.15); + background: rgba(0, 0, 0, 0.15); word-wrap: break-word; overflow-wrap: break-word; word-break: break-space; @@ -82,7 +90,11 @@ pre > code { line-height: 1.5em; } -.panel, .tip, .info, .note, .warning { +.panel, +.tip, +.info, +.note, +.warning { display: inline-block; width: 90%; color: black; @@ -106,32 +118,46 @@ pre > code { border-top: none; } -.info, .info-title, .info-body { +.info, +.info-title, +.info-body { border-color: #aab8c6; border-style: solid; background-color: #fcfcfc; } -.tip, .tip-title, .tip-body { +.tip, +.tip-title, +.tip-body { border-color: #91c89c; border-style: solid; background-color: #f3f9f4; } -.note, .note-title, .note-body { +.note, +.note-title, +.note-body { border-color: #ffeaae; border-style: solid; background-color: #fffdf6; } -.warning, .warning-title, .warning-body { +.warning, +.warning-title, +.warning-body { border-color: #d04437; border-style: solid; background-color: #fff8f7; } -.info-title, .tip-title, .note-title, .warning-title, -.info-title-iconless, .tip-title-iconless, .note-title-iconless, .warning-title-iconless { +.info-title, +.tip-title, +.note-title, +.warning-title, +.info-title-iconless, +.tip-title-iconless, +.note-title-iconless, +.warning-title-iconless { font-weight: bold; padding: 2px; margin: 0px; @@ -143,7 +169,10 @@ pre > code { border-bottom: none; } -.info-body, .tip-body, .note-body, .warning-body { +.info-body, +.tip-body, +.note-body, +.warning-body { padding: 2px; margin: 0px; padding-left: 35px; @@ -154,34 +183,47 @@ pre > code { border-top: none; } -.info-title:before, .tip-title:before, .note-title:before, .warning-title:before, -.info-title-iconless:before, .tip-title-iconless:before, .note-title-iconless:before, .warning-title-iconless:before { +.info-title:before, +.tip-title:before, +.note-title:before, +.warning-title:before, +.info-title-iconless:before, +.tip-title-iconless:before, +.note-title-iconless:before, +.warning-title-iconless:before { margin-left: -16px; margin-right: 5px; vertical-align: middle; } -.info-title:before, .info-title-iconless:before { +.info-title:before, +.info-title-iconless:before { content: url('./../icons/macro-info.png'); } -.tip-title:before, .tip-title-iconless:before { +.tip-title:before, +.tip-title-iconless:before { content: url('./../icons/macro-tip.png'); } -.note-title:before, .note-title-iconless:before { +.note-title:before, +.note-title-iconless:before { content: url('./../icons/macro-note.png'); } -.warning-title:before, .warning-title-iconless:before { +.warning-title:before, +.warning-title-iconless:before { content: url('./../icons/macro-warning.png'); } -.info-title-iconless:before, .tip-title-iconless:before,.note-title-iconless:before, .warning-title-iconless:before { +.info-title-iconless:before, +.tip-title-iconless:before, +.note-title-iconless:before, +.warning-title-iconless:before { opacity: 0.0; } -pre > code > p { +pre>code>p { margin: .5em 0; } @@ -197,10 +239,10 @@ ol.initial { list-style: decimal; } -ol.initial > ol { +ol.initial>li>ol { list-style-type: lower-alpha; } -ol.initial > ol > ol { +ol.initial>li>ol>li>ol { list-style-type: lower-roman; } From 55f3f288f50101ad45e771d4db554ec5d5794f71 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Thu, 9 Nov 2023 16:34:34 +0100 Subject: [PATCH 06/32] disable render empty line --- src/markupParser.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/markupParser.ts b/src/markupParser.ts index fc1b5e2..70ca754 100644 --- a/src/markupParser.ts +++ b/src/markupParser.ts @@ -67,7 +67,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { && (!tableFlag) && (!codeTagFlag) ) { - result += '
    '; + // result += '
    '; continue; } From ec0a00abb6496c6b126c0a44e8f8cced10f18eb7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Thu, 9 Nov 2023 16:34:47 +0100 Subject: [PATCH 07/32] fix test --- src/test/suite/markupParser.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/suite/markupParser.test.ts b/src/test/suite/markupParser.test.ts index 7578cee..bdc5d15 100644 --- a/src/test/suite/markupParser.test.ts +++ b/src/test/suite/markupParser.test.ts @@ -70,11 +70,11 @@ suite("MarkupParser Tests", function () { let project_root_dir = PROJECT_ROOT_DIR; if (process.platform === 'win32') { - project_root_dir = `${project_root_dir.split(path.sep).join(path.posix.sep).replace(':', '%3A')}`; + project_root_dir = `/${project_root_dir.split(path.sep).join(path.posix.sep).replace(':', '%3A')}`; } const expectedContent = prettier.format( - fs.readFileSync(fixtureFile, FILE_ENCODING).replace(new RegExp(TEST_EXTENSION_PATH_PLACEHOLDER, 'g'), `${TEST_EXTENSION_PATH_PLACEHOLDER_REPLACE_PREFIX}/${project_root_dir}`), + fs.readFileSync(fixtureFile, FILE_ENCODING).replace(new RegExp(TEST_EXTENSION_PATH_PLACEHOLDER, 'g'), `${TEST_EXTENSION_PATH_PLACEHOLDER_REPLACE_PREFIX}${project_root_dir}`), { parser: "html" } ); From 296124003b610b029b1442206bba874b100d551d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Thu, 9 Nov 2023 16:49:09 +0100 Subject: [PATCH 08/32] define prettier eol --- src/test/suite/markupParser.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/suite/markupParser.test.ts b/src/test/suite/markupParser.test.ts index bdc5d15..755f343 100644 --- a/src/test/suite/markupParser.test.ts +++ b/src/test/suite/markupParser.test.ts @@ -75,7 +75,7 @@ suite("MarkupParser Tests", function () { const expectedContent = prettier.format( fs.readFileSync(fixtureFile, FILE_ENCODING).replace(new RegExp(TEST_EXTENSION_PATH_PLACEHOLDER, 'g'), `${TEST_EXTENSION_PATH_PLACEHOLDER_REPLACE_PREFIX}${project_root_dir}`), - { parser: "html" } + { parser: "html", endOfLine: 'auto'} ); const testFileUri = vscode.Uri.file(fullFilePath); @@ -83,7 +83,7 @@ suite("MarkupParser Tests", function () { // const rawRenderedHtml = `${testName}${parseMarkup(testFileUri, confluenceContent)}`; const rawRenderedHtml = parseMarkup(testFileUri, confluenceContent); - const formattedContent = prettier.format(rawRenderedHtml, { parser: "html" }); + const formattedContent = prettier.format(rawRenderedHtml, { parser: "html", endOfLine: 'auto'}); assert.strictEqual(expectedContent, formattedContent); }); }); From 4b8efc7dd4525d1e657f4602092c34226e23dd74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Thu, 9 Nov 2023 16:54:49 +0100 Subject: [PATCH 09/32] define prettier eol --- src/test/suite/markupParser.test.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/test/suite/markupParser.test.ts b/src/test/suite/markupParser.test.ts index 755f343..730c039 100644 --- a/src/test/suite/markupParser.test.ts +++ b/src/test/suite/markupParser.test.ts @@ -75,7 +75,7 @@ suite("MarkupParser Tests", function () { const expectedContent = prettier.format( fs.readFileSync(fixtureFile, FILE_ENCODING).replace(new RegExp(TEST_EXTENSION_PATH_PLACEHOLDER, 'g'), `${TEST_EXTENSION_PATH_PLACEHOLDER_REPLACE_PREFIX}${project_root_dir}`), - { parser: "html", endOfLine: 'auto'} + { parser: "html", endOfLine: 'lf'} ); const testFileUri = vscode.Uri.file(fullFilePath); @@ -83,7 +83,7 @@ suite("MarkupParser Tests", function () { // const rawRenderedHtml = `${testName}${parseMarkup(testFileUri, confluenceContent)}`; const rawRenderedHtml = parseMarkup(testFileUri, confluenceContent); - const formattedContent = prettier.format(rawRenderedHtml, { parser: "html", endOfLine: 'auto'}); + const formattedContent = prettier.format(rawRenderedHtml, { parser: "html", endOfLine: 'lf'}); assert.strictEqual(expectedContent, formattedContent); }); }); From 4e0a8b3fd8d7981145091672cc89aa3e80dacdea Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 06:55:22 +0100 Subject: [PATCH 10/32] add fixtures common dir --- .gitattributes | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitattributes b/.gitattributes index 1562bd4..44f8bf6 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,3 +1,4 @@ * text=auto +**/common/**/*.confluence text eol=lf **/nix/**/*.confluence text eol=lf **/win/**/*.confluence text eol=crlf From fd5c142a2fba145f45cb0731c4765a0af308d2bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 06:56:12 +0100 Subject: [PATCH 11/32] normalize eol in fixture files --- src/test/suite/markupParser.test.ts | 30 +++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/src/test/suite/markupParser.test.ts b/src/test/suite/markupParser.test.ts index 730c039..70d7afb 100644 --- a/src/test/suite/markupParser.test.ts +++ b/src/test/suite/markupParser.test.ts @@ -47,9 +47,9 @@ suite("MarkupParser Tests", function () { }); const eolMap = new Map(); - eolMap.set("LF", "\n"); - eolMap.set("CR", "\r"); - eolMap.set("CRLF", "\r\n"); + eolMap.set('lf', "\n"); + eolMap.set('cr', "\r"); + eolMap.set('crlf', "\r\n"); for (const eolMapKey of eolMap.keys()) { @@ -64,26 +64,36 @@ suite("MarkupParser Tests", function () { typeDir = path.basename(path.dirname(dirName)); } - const testName = `Render testfile: ${path.join(typeDir, scopedDir, fileName)} with EOL: ${eolMapKey}` + const testName = `Render testfile: ${path.join(typeDir, scopedDir, fileName)} with EOL: ${eolMapKey.toUpperCase()}` test(testName, function () { const fixtureFile = path.join(FIXTURES_ROOT, scopedDir, fileName.replace(CONFLUENCE_FILENAME_EXTENSION, HTML_FILENAME_EXTENSION)); + const testFileUri = vscode.Uri.file(fullFilePath); let project_root_dir = PROJECT_ROOT_DIR; if (process.platform === 'win32') { project_root_dir = `/${project_root_dir.split(path.sep).join(path.posix.sep).replace(':', '%3A')}`; } + const readedFixtureContent = fs.readFileSync(fixtureFile, FILE_ENCODING) + .replace(new RegExp(TEST_EXTENSION_PATH_PLACEHOLDER, 'g'), `${TEST_EXTENSION_PATH_PLACEHOLDER_REPLACE_PREFIX}${project_root_dir}`) + .replace(/\r?\n/g, eolMap.get(eolMapKey)); //fix win git checkout issue: normalize eol + const expectedContent = prettier.format( - fs.readFileSync(fixtureFile, FILE_ENCODING).replace(new RegExp(TEST_EXTENSION_PATH_PLACEHOLDER, 'g'), `${TEST_EXTENSION_PATH_PLACEHOLDER_REPLACE_PREFIX}${project_root_dir}`), - { parser: "html", endOfLine: 'lf'} + readedFixtureContent, + { parser: "html", endOfLine: eolMapKey } ); - const testFileUri = vscode.Uri.file(fullFilePath); - const confluenceContent = fs.readFileSync(testFileUri.fsPath, FILE_ENCODING).replace(/\n/g, eolMap.get(eolMapKey)); + const confluenceContent = fs.readFileSync(testFileUri.fsPath, FILE_ENCODING) + .replace(/\r?\n/g, eolMap.get(eolMapKey)); //fix win git checkout issue: normalize eol - // const rawRenderedHtml = `${testName}${parseMarkup(testFileUri, confluenceContent)}`; + // // const rawRenderedHtml = `${testName}${parseMarkup(testFileUri, confluenceContent)}`; const rawRenderedHtml = parseMarkup(testFileUri, confluenceContent); - const formattedContent = prettier.format(rawRenderedHtml, { parser: "html", endOfLine: 'lf'}); + + const formattedContent = prettier.format( + rawRenderedHtml, + { parser: "html", endOfLine: eolMapKey } + ); + assert.strictEqual(expectedContent, formattedContent); }); }); From dd36b4a62cc6abc019c98192bc3ec674d0aa6af8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 08:29:14 +0100 Subject: [PATCH 12/32] fix leading spaces in noformat/code macros --- src/markupParser.ts | 14 +++++++++----- src/test/suite/fixtures/expected/test.html | 9 +++++++-- 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/src/markupParser.ts b/src/markupParser.ts index 70ca754..eee6b58 100644 --- a/src/markupParser.ts +++ b/src/markupParser.ts @@ -59,7 +59,12 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { let listArr: string[] = []; for (const entry of sourceText.split(/\r?\n|\r/gi)) { - let tag = entry.trim(); //remove leading and trailing spaces + let tag = entry + + if (!codeTagFlag) { + tag = tag.trim(); //remove leading and trailing spaces + } + let html_tag = false; if ((tag.length === 0) @@ -72,7 +77,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { } if (!codeTagFlag) { - tag = tag.replace(/h(\d+)\.\s([^\n]+)/g, "$2"); + tag = tag.replace(/h(\d+)\.\s([^\r?\n]+)/g, "$2"); // tag = tag.replace(/_([^_]*)_/g, "$1"); tag = tag.replace(/\+([^+]*)\+/g, "$1"); @@ -407,11 +412,10 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { if (!tag.match(/<\/?code|<\/?pre>|<\/?table>|<\/?t[r|d|h]|<\/?li|<\/?ul|<\/?ol|<\/?div/) && !codeTagFlag) { tag = `
    ${tag}
    `; - } else if (codeTagFlag && tag.indexOf('>') < 0) { - tag = tag + '\n'; + } else if (codeTagFlag && tag.indexOf('<') < 0) { + tag = `${tag}\n`; } result += `${tag}`; } - return result; } diff --git a/src/test/suite/fixtures/expected/test.html b/src/test/suite/fixtures/expected/test.html index 5ee8373..8a7b89b 100644 --- a/src/test/suite/fixtures/expected/test.html +++ b/src/test/suite/fixtures/expected/test.html @@ -205,7 +205,10 @@

    code:

    test -
    <test><test1 /></test>
    +
    <test>
    +    <test1 />
    +</test>
    +
    title @@ -219,6 +222,8 @@

    code:

    noformat:

    -
    <xml></xml>
    +
    <xml>
    +</xml>
    +
    noformat <tag></tag> oneline
    From a7523092d740d467546aa5926e1a3e5623dd64ef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 08:57:42 +0100 Subject: [PATCH 13/32] set default div setting as paragraph --- media/css/confluence.css | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/media/css/confluence.css b/media/css/confluence.css index 737ae44..db3ee5d 100644 --- a/media/css/confluence.css +++ b/media/css/confluence.css @@ -1,10 +1,15 @@ body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"; - padding: 0 26px; + padding: 0 30px; line-height: 1em; word-wrap: break-word; } +div { + margin-top: 1em; + margin-bottom: 1em; +} + img { max-width: 100%; max-height: 100%; From 9b0bc1b9bb6e68f5c76c6585816b64125a18c181 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 08:58:57 +0100 Subject: [PATCH 14/32] add title tag --- src/extension.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/extension.ts b/src/extension.ts index d13c863..8967c6a 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -19,6 +19,7 @@ function getRenderedContent(contentProvider: ConfluenceContentProvider, uri: vsc const cssUrl = panel.webview.asWebviewUri(cssFile) cssLink = `` } + const title = 'Preview ' + path.basename(uri.fsPath); panel.webview.html = ` @@ -30,6 +31,7 @@ function getRenderedContent(contentProvider: ConfluenceContentProvider, uri: vsc script-src self vscode-resource:; style-src 'unsafe-inline' self vscode-resource:;"/> ${cssLink} + ${title} ${renderedContent} From 84ac512deb48734aca059abd87060033501e9377 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 08:59:51 +0100 Subject: [PATCH 15/32] wrap panel with div, fix noformat/code oneliner --- src/markupParser.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/markupParser.ts b/src/markupParser.ts index eee6b58..de999ec 100644 --- a/src/markupParser.ts +++ b/src/markupParser.ts @@ -168,7 +168,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { // code // oneline code and noformat tag tag = tag.replace(/\{(noformat|code)[^}]*\}(.*)\{(noformat|code)\}/, function (m0, m1, m2) { - return `
    ${m2.replace(/
    `; + return `
    ${m2.replace(/
    `; }); @@ -181,7 +181,6 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { // Title style is unecessary for now. It can't be easily customized in Confluence. // let titleStyle = ""; tag = tag.replace(code_re, function (m0, m1, m2) { - // let res = '
    '
     					let res = `
    `;
     					const splits = m2.split(/[|:]/);
     					splits.forEach((el: string) => {
    @@ -249,7 +248,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) {
     					splits.forEach((el: string) => {
     						const elems = el.split('=');
     						if (elems[0] === "title") {
    -							res = `
    ${elems[1]}
    ${res}`; + res = `
    ${elems[1]}
    ${res}`; } if (elems[0] === "titleBGColor") { if (titleStyle.length === 0) { @@ -315,7 +314,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { panelStyle = ""; titleStyle = ""; if (!res.match(`${panelClass}-title`)) { - res = `
    ${res}`; + res = `
    ${res}`; } } @@ -326,7 +325,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { }); panelTagFlag = true; } else { - tag = '
    '; + tag = '
    '; if (listFlag) { tag = `${tag}`; } From 6353d9778c08812ed8999430dfff78d424fb43b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 10:05:18 +0100 Subject: [PATCH 16/32] remove trailing slash on meta tag --- src/extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index 8967c6a..51d5be2 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -29,7 +29,7 @@ function getRenderedContent(contentProvider: ConfluenceContentProvider, uri: vsc content="default-src 'none'; img-src self vscode-resource: https:; script-src self vscode-resource:; - style-src 'unsafe-inline' self vscode-resource:;"/> + style-src 'unsafe-inline' self vscode-resource:;"> ${cssLink} ${title} From f43faccdcf4ebfac2e29ef7d6f378479c4f0308a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 10:06:10 +0100 Subject: [PATCH 17/32] add wrap div for panel withou title --- src/markupParser.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/markupParser.ts b/src/markupParser.ts index de999ec..66e537f 100644 --- a/src/markupParser.ts +++ b/src/markupParser.ts @@ -316,6 +316,10 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { if (!res.match(`${panelClass}-title`)) { res = `
    ${res}`; } + } else { + if (!res.match(`${panelClass}-title`)) { + res = `
    ${res}`; // wrap titleles panel; + } } res = res.replace('$iconlessFlag', iconlessFlag); From 867e431653a668d7fd6d6b19b0329816f7e9ee3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 10:06:51 +0100 Subject: [PATCH 18/32] adjust test files with div wraps --- .../suite/fixtures/expected/issue_41.html | 224 +++++++++++------- src/test/suite/fixtures/expected/issues.html | 46 ++-- src/test/suite/fixtures/expected/test.html | 10 +- 3 files changed, 167 insertions(+), 113 deletions(-) diff --git a/src/test/suite/fixtures/expected/issue_41.html b/src/test/suite/fixtures/expected/issue_41.html index f1ae2b6..fa973b4 100644 --- a/src/test/suite/fixtures/expected/issue_41.html +++ b/src/test/suite/fixtures/expected/issue_41.html @@ -8,102 +8,146 @@

    macro-info

    -
    This is info title
    -
    This is Info information.
    -
    -
    -
    This is info without title information.
    -
    -
    Info with title w/o icon
    -
    This is Info information.
    -
    -
    INFO: titleless and iconless
    -
    This is my title
    -
    -
    This is important information.
    +
    +
    This is info title
    +
    This is Info information.
    +
    +
    +
    +
    +
    This is info without title information.
    +
    +
    +
    +
    Info with title w/o icon
    +
    This is Info information.
    +
    +
    +
    +
    INFO: titleless and iconless
    +
    +
    +
    This is my title
    +
    +
    This is important information.
    +

    macro-tip

    -
    This is tip title
    -
    This is Tip information.
    -
    -
    -
    This is tip without title information.
    -
    -
    Tip with title w/o icon
    -
    This is Tip information.
    -
    -
    TIP: titleless and iconless
    +
    +
    This is tip title
    +
    This is Tip information.
    +
    +
    +
    +
    +
    This is tip without title information.
    +
    +
    +
    +
    Tip with title w/o icon
    +
    This is Tip information.
    +
    +
    +
    +
    TIP: titleless and iconless
    +

    macro-note

    -
    This is note title
    -
    This is note information.
    -
    -
    -
    This is note without title information.
    -
    -
    Note with title w/o icon
    -
    This is note information.
    -
    -
    NOTE: titleless and iconless
    +
    +
    This is note title
    +
    This is note information.
    +
    +
    +
    +
    +
    This is note without title information.
    +
    +
    +
    +
    Note with title w/o icon
    +
    This is note information.
    +
    +
    +
    +
    NOTE: titleless and iconless
    +

    macro-warning

    -
    This is warning title
    -
    This is warning information.
    -
    -
    -
    This is warning without title information.
    +
    +
    This is warning title
    +
    +
    This is warning information.
    +
    -
    - This is warning title without icon +
    +
    +
    +
    This is warning without title information.
    +
    -
    This is warning information.
    -
    -
    -
    WARNING: titleless and iconless
    +
    +
    + This is warning title without icon +
    +
    +
    This is warning information.
    +
    +
    +
    +
    +
    +
    WARNING: titleless and iconless
    +

    formatted panel

    -
    - My title -
    -
    -
    A formatted panel
    -
    -
    - My title -
    -
    -
    A formatted panel
    -
    -
    - My title -
    -
    -
    A formatted panel
    +
    +
    + My title +
    +
    +
    A formatted panel
    +
    +
    +
    +
    + My title +
    +
    +
    A formatted panel
    +
    +
    +
    +
    + My title +
    +
    +
    A formatted panel
    +
    diff --git a/src/test/suite/fixtures/expected/issues.html b/src/test/suite/fixtures/expected/issues.html index 87c6451..1e8ec51 100644 --- a/src/test/suite/fixtures/expected/issues.html +++ b/src/test/suite/fixtures/expected/issues.html @@ -121,26 +121,32 @@

    Issues

    #22 panel support
    -
    Some text
    -
    My Title
    -
    Some text with a title
    -
    - My Title -
    -
    -
    a block of text surrounded with a panel
    -
    yet another line
    +
    +
    Some text
    +
    +
    +
    My Title
    +
    Some text with a title
    +
    +
    +
    + My Title +
    +
    +
    a block of text surrounded with a panel
    +
    yet another line
    +
    #24: diff --git a/src/test/suite/fixtures/expected/test.html b/src/test/suite/fixtures/expected/test.html index 8a7b89b..ad993b0 100644 --- a/src/test/suite/fixtures/expected/test.html +++ b/src/test/suite/fixtures/expected/test.html @@ -205,7 +205,7 @@

    code:

    test -
    <test>
    +  
    <test>
         <test1 />
     </test>
     
    @@ -216,7 +216,9 @@

    code:

    echo very long command line with a lot of sings to check word wrap and how it looks like && echo much more elements to print
    -
    code oneline
    +
    +
    code oneline
    +

    noformat:

    @@ -226,4 +228,6 @@

    noformat:

    </xml>
    -
    noformat <tag></tag> oneline
    +
    +
    noformat <tag></tag> oneline
    +
    From b109453cb8ddcc24aa9d25b5fb44c5dd400649f6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 10:23:41 +0100 Subject: [PATCH 19/32] use GITHUB_OUTPUT variable instead of set-output --- .github/workflows/cd.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 08c953f..1941cc7 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -31,7 +31,8 @@ jobs: run: npm run build # https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions - name: Get release version - run: echo "::set-output name=version::${GITHUB_REF#refs/*/}" + # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter + run: echo "version=${GITHUB_REF#refs/*/}" >> "$GITHUB_OUTPUT" id: release-version - name: Create release notes for version ${{ steps.release-version.outputs.version }} # run: npm run --silent changelog > RELEASE_NOTES_${{ steps.release-version.outputs.version }}.md From 83f9935845c944a716175e10ec396970b247b019 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 10:29:20 +0100 Subject: [PATCH 20/32] create and publish extension package checksum --- .github/workflows/cd.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml index 1941cc7..569fddc 100644 --- a/.github/workflows/cd.yml +++ b/.github/workflows/cd.yml @@ -29,6 +29,8 @@ jobs: run: npm ci - name: Build extension package run: npm run build + - name: Build checksum + run: sha512sum confluence-markup-${{ steps.release-version.outputs.version }}.vsix > confluence-markup-${{ steps.release-version.outputs.version }}.vsix.sha512 # https://docs.github.com/en/actions/reference/workflow-commands-for-github-actions - name: Get release version # https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#setting-an-output-parameter @@ -48,8 +50,8 @@ jobs: uses: ncipollo/release-action@v1 with: name: ${{ steps.release-version.outputs.version }} - artifact: "confluence-markup-${{ steps.release-version.outputs.version }}.vsix" - artifactContentType: application/zip + artifacts: "confluence-markup-${{ steps.release-version.outputs.version }}.vsix,confluence-markup-${{ steps.release-version.outputs.version }}.vsix.sha512" + # artifactContentType: application/zip bodyFile: "RELEASE_NOTES_${{ steps.release-version.outputs.version }}.md" token: ${{ secrets.GITHUB_TOKEN }} - name: Publish to Visual Studio Marketplace From 5eaf3e2c228e00c343354549872d630c91751c88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 10:30:13 +0100 Subject: [PATCH 21/32] bump vscode engine to 1.84.0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index de2833d..e391af8 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "license": "MIT", "homepage": "https://github.com/denco/vscode-confluence-markup/blob/master/README.md", "engines": { - "vscode": "^1.75.0" + "vscode": "^1.84.0" }, "activationEvents": [], "main": "./out/extension", From 59288f1307053a1c6294d180ad242ffbf11a18a8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 11:00:37 +0100 Subject: [PATCH 22/32] remove panel-title/body border --- media/css/confluence.css | 2 -- 1 file changed, 2 deletions(-) diff --git a/media/css/confluence.css b/media/css/confluence.css index db3ee5d..37a0055 100644 --- a/media/css/confluence.css +++ b/media/css/confluence.css @@ -113,14 +113,12 @@ pre>code { font-weight: bold; padding: 5px 3px; border-style: solid; - /* border-bottom: none; */ } .panel-body { background-color: lightgrey; padding: 3px; border-style: solid; - border-top: none; } .info, From eff15a4c2c8d14fd96b7af8d26f390a9743a47d6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 11:01:51 +0100 Subject: [PATCH 23/32] wrap table with div --- src/markupParser.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/markupParser.ts b/src/markupParser.ts index 66e537f..31b89a6 100644 --- a/src/markupParser.ts +++ b/src/markupParser.ts @@ -159,7 +159,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { } tag = '' + tag + ''; if (tableFlag == false) { - tag = '' + tag; + tag = '
    ' + tag; } tableFlag = true; } @@ -409,7 +409,7 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { //close table if (!tag.match(/<\/tr>$/) && tableFlag) { - tag = '
    ' + tag; + tag = '
    ' + tag; tableFlag = false; } From 8774d08001dbd54f0f505e8adbf84e9f7e212b62 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 11:02:24 +0100 Subject: [PATCH 24/32] adjust expected files with div wrap for tables --- src/test/suite/fixtures/expected/issues.html | 76 ++++---- .../fixtures/expected/scoped/tables.html | 170 +++++++++--------- src/test/suite/fixtures/expected/test.html | 40 +++-- 3 files changed, 151 insertions(+), 135 deletions(-) diff --git a/src/test/suite/fixtures/expected/issues.html b/src/test/suite/fixtures/expected/issues.html index 1e8ec51..c24155f 100644 --- a/src/test/suite/fixtures/expected/issues.html +++ b/src/test/suite/fixtures/expected/issues.html @@ -15,18 +15,20 @@

    Issues

    Table without heading

    Table without heading

    - - - - - - - - - - - -
    testtest
    simple tabletwo
    +
    + + + + + + + + + + + +
    testtest
    simple tabletwo
    +
    #6: Intenting @@ -192,30 +194,32 @@

    Issues

    #38 Preview is not working using links inside a table
    - - - - - - - - - - - - - - - - - - - - - - - -
    heading 1heading 2heading 3
    cell A1cell A2cell A3
    cell B1cell B2cell B3
    examplegooglevscode
    +
    + + + + + + + + + + + + + + + + + + + + + + + +
    heading 1heading 2heading 3
    cell A1cell A2cell A3
    cell B1cell B2cell B3
    examplegooglevscode
    +
    #39 Local image preview diff --git a/src/test/suite/fixtures/expected/scoped/tables.html b/src/test/suite/fixtures/expected/scoped/tables.html index b00ac32..91698d7 100644 --- a/src/test/suite/fixtures/expected/scoped/tables.html +++ b/src/test/suite/fixtures/expected/scoped/tables.html @@ -1,86 +1,96 @@

    Tables

    Column heading

    - - - - - - - - - - - - - - - -
    header c1header c2
    data 1.1data 1.2
    data 2.1data 2.2
    +
    + + + + + + + + + + + + + + + +
    header c1header c2
    data 1.1data 1.2
    data 2.1data 2.2
    +

    Row heading

    - - - - - - - - - - - - - - - - - - -
    header r1data 1.1data 1.2
    header r2data 2.1data 2.2
    header r3data 3.1data 3.2
    +
    + + + + + + + + + + + + + + + + + + +
    header r1data 1.1data 1.2
    header r2data 2.1data 2.2
    header r3data 3.1data 3.2
    +

    Column and row heading

    - - - - - - - - - - - - - - - - - - -
    header c1header c2
    header r1data 1.1data 1.2
    header r2data 2.1data 2.2
    +
    + + + + + + + + + + + + + + + + + + +
    header c1header c2
    header r1data 1.1data 1.2
    header r2data 2.1data 2.2
    +

    Without heading

    - - - - - - - - - - - -
    data 1.1data 1.2
    data 2.1data 2.2
    +
    + + + + + + + + + + + +
    data 1.1data 1.2
    data 2.1data 2.2
    +

    Table with nested macros (not supported yet)

    - - - - - - - - - - - -
    Heading 1Heading 2
    - Item 1
    Item 2
    * Item 3 -
    # Item 1
    # Item 2
    # Item 3
    +
    + + + + + + + + + + + +
    Heading 1Heading 2
    + Item 1
    Item 2
    * Item 3 +
    # Item 1
    # Item 2
    # Item 3
    +
    diff --git a/src/test/suite/fixtures/expected/test.html b/src/test/suite/fixtures/expected/test.html index ad993b0..27d6131 100644 --- a/src/test/suite/fixtures/expected/test.html +++ b/src/test/suite/fixtures/expected/test.html @@ -180,25 +180,27 @@

    lists:

    table:

    - - - - - - - - - - - - - - - - - - -
    heading 1heading 2heading 3
    cell A1cell A2cell A3
    cell B1cell B2cell B3
    +
    + + + + + + + + + + + + + + + + + + +
    heading 1heading 2heading 3
    cell A1cell A2cell A3
    cell B1cell B2cell B3
    +

    code:

    From cb5ea27798a261bf6ad878c7162d508351c75b46 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 12:01:18 +0100 Subject: [PATCH 25/32] add styles for th --- media/css/confluence.css | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/media/css/confluence.css b/media/css/confluence.css index 37a0055..ae746ea 100644 --- a/media/css/confluence.css +++ b/media/css/confluence.css @@ -60,6 +60,14 @@ td { padding: 7px; } +.vscode-light th { + background-color: rgba(0, 0, 0, 0.18); +} + +.vscode-dark th { + background-color: rgba(255, 255, 255, 0.18); +} + .code-block { display: block; width: 90%; From 0e1b39f1d34a11fc5cbeb0f4c321c64f3a7f62f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 12:15:55 +0100 Subject: [PATCH 26/32] use switch/case instead of if --- src/markupParser.ts | 84 +++++++++++++++------------------------------ 1 file changed, 27 insertions(+), 57 deletions(-) diff --git a/src/markupParser.ts b/src/markupParser.ts index 31b89a6..02c04c9 100644 --- a/src/markupParser.ts +++ b/src/markupParser.ts @@ -247,68 +247,38 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { const splits = m2.split(/[|:]/); splits.forEach((el: string) => { const elems = el.split('='); - if (elems[0] === "title") { - res = `
    ${elems[1]}
    ${res}`; - } - if (elems[0] === "titleBGColor") { - if (titleStyle.length === 0) { - titleStyle = `style='background-color: ${elems[1]};`; - } else { - titleStyle += ` background-color: ${elems[1]};`; - } - } - if (elems[0] === "bgColor") { - if (panelStyle.length === 0) { - panelStyle = `style='background-color: ${elems[1]};`; - } else { - panelStyle += ` background-color: ${elems[1]};`; - } - } - if (elems[0] === "borderStyle") { - if (panelStyle.length === 0) { - panelStyle = `style='border-style: ${elems[1]}; `; - } else { - panelStyle += ` border-style: ${elems[1]}; `; - } - if (titleStyle.length === 0) { - titleStyle = `style='border-style: ${elems[1]}; border-bottom:none; `; - } else { - titleStyle += ` border-style: ${elems[1]}; border-bottom:none; `; - } - } - if (elems[0] === "borderColor") { - if (panelStyle.length === 0) { - panelStyle = `style='border-color: ${elems[1]}; `; - } else { - panelStyle += ` border-color: ${elems[1]}; `; - } - if (titleStyle.length === 0) { - titleStyle = `style='border-color: ${elems[1]}; `; - } else { - titleStyle += ` border-color: ${elems[1]}; `; - } - } - if (elems[0] === "borderWidth") { - if (panelStyle.length === 0) { - panelStyle = `style='border-width: ${elems[1]}; `; - } else { - panelStyle += ` border-width: ${elems[1]}; `; - } - if (titleStyle.length === 0) { - titleStyle = `style='border-width: ${elems[1]}; `; - } else { - titleStyle += ` border-width: ${elems[1]}; `; - } - } - if (elems[0] === "icon" && elems[1] === "false") { - iconlessFlag = "-iconless"; + switch (elems[0]) { + case "title": + res = `
    ${elems[1]}
    ${res}`; + break; + case "titleBGColor": + titleStyle += `background-color: ${elems[1]}; `; + break; + case "bgColor": + panelStyle += `background-color: ${elems[1]}; `; + break; + case "borderStyle": + panelStyle += `border-style: ${elems[1]}; `; + titleStyle += `border-style: ${elems[1]}; border-bottom:none; `; + break; + case "borderColor": + panelStyle += `border-color: ${elems[1]}; `; + titleStyle += `border-color: ${elems[1]}; `; + break; + case "borderWidth": + panelStyle += `border-width: ${elems[1]}; `; + titleStyle += `border-width: ${elems[1]}; `; + break; + case "icon": + iconlessFlag = (elems[1] === "false") ? "-iconless" : ""; + break; } }); if (titleStyle.length > 0) { - titleStyle += `'`; + titleStyle = `style='${titleStyle.trim()}'`; } if (panelStyle.length > 0) { - panelStyle += `'`; + panelStyle = `style='${panelStyle.trim()}'`; } if (panelClass != 'panel') { panelStyle = ""; From b6a2a68234e4faa703061337d47a53b8bd90b3e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Fri, 10 Nov 2023 14:18:59 +0100 Subject: [PATCH 27/32] code cleanup, add render in word italics --- src/markupParser.ts | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) diff --git a/src/markupParser.ts b/src/markupParser.ts index 02c04c9..64acc97 100644 --- a/src/markupParser.ts +++ b/src/markupParser.ts @@ -79,7 +79,6 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { if (!codeTagFlag) { tag = tag.replace(/h(\d+)\.\s([^\r?\n]+)/g, "$2"); - // tag = tag.replace(/_([^_]*)_/g, "$1"); tag = tag.replace(/\+([^+]*)\+/g, "$1"); tag = tag.replace(/\^([^^]*)\^/g, "$1"); tag = tag.replace(/~([^~]*)~/g, "$1"); @@ -307,7 +306,6 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { } } - // if (! codeTagFlag) { // lists const li_re = /^([-*#]+)\s(.*)/; const li_match = tag.match(li_re); @@ -337,13 +335,9 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { tag = ''; listArr = listArr.slice(0, li_match[1].length); } - // // This prevents the closing tag from being added too prematurely. - // if (codeTagFlag || panelTagFlag) { + // This prevents the closing tag from being added too prematurely. + // ToDo: lists are 'open', means not all tags are closed tag += "
  • " + li_match[2]; - // } else { - // // tag += "
  • " + li_match[2] + "
  • "; - // tag += "
  • " + li_match[2]; - // } } @@ -363,19 +357,16 @@ export function parseMarkup(sourceUri: vscode.Uri, sourceText: string) { // strong tag = tag.replace(/\*([^*]*)\*/g, "$1"); - // line-through + + // line-through and italic if ((!html_tag) && (!tag.match('$1 "); - // tag = tag.replace(/_([^_]*)_/g, "$1"); + // special case: in word italic + // s. https://confluence.atlassian.com/doc/confluence-wiki-markup-251003035.html#ConfluenceWikiMarkup-TextEffects + tag = tag.replace(/{_}([^_]*)_/g, "$1"); tag = tag.replace(/\B-((\([^)]*\)|{[^}]*}|\[[^]]+\]){0,3})(\S.*?\S|\S)-\B/g, " $3 "); tag = tag.replace(/(?:\b)_((\([^)]*\)|{[^}]*}|\[[^]]+\]){0,3})(\S.*?\S|\S)_(?:\b)/g, "$3"); } - // This only really applied to the inner part of code blocks and noformat blocks, so I moved it there and used a flag to trigger it. - // } else { - // if (tag !== `
    `) {
    -		// 		tag = tag.replace(/';
    -		// 	}
    -		// }
     
     		//close table
     		if (!tag.match(/<\/tr>$/) && tableFlag) {
    
    From 5f6a57e391234434f1e0d261ffc4a9087e945671 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= 
    Date: Fri, 10 Nov 2023 14:19:44 +0100
    Subject: [PATCH 28/32] adjusts test for in word italics
    
    ---
     src/test/suite/fixtures/expected/test.html               | 2 +-
     src/test/suite/fixtures/testfiles/common/test.confluence | 2 +-
     2 files changed, 2 insertions(+), 2 deletions(-)
    
    diff --git a/src/test/suite/fixtures/expected/test.html b/src/test/suite/fixtures/expected/test.html
    index 27d6131..5cde534 100644
    --- a/src/test/suite/fixtures/expected/test.html
    +++ b/src/test/suite/fixtures/expected/test.html
    @@ -127,7 +127,7 @@ 

    text effects:

    strong
    bold text
    emphasis
    -
    italics : Thing_x_
    +
    italics : Thingx
    italics with spaces
    citation
    deleted
    diff --git a/src/test/suite/fixtures/testfiles/common/test.confluence b/src/test/suite/fixtures/testfiles/common/test.confluence index 6c892aa..82f94a5 100644 --- a/src/test/suite/fixtures/testfiles/common/test.confluence +++ b/src/test/suite/fixtures/testfiles/common/test.confluence @@ -43,7 +43,7 @@ h2. *text effects:* _emphasis_ -_italics_ : Thing_x_ +_italics_ : Thing{_}x_ _italics with spaces_ From ddd262cd03b3fc0af0bd8ffda34783db5d5349fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Thu, 16 Nov 2023 18:24:22 +0100 Subject: [PATCH 29/32] disable lo on disposed window --- src/extension.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index 51d5be2..ad9839f 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -39,7 +39,8 @@ function getRenderedContent(contentProvider: ConfluenceContentProvider, uri: vsc `; } }, (reason) => { - vscode.window.showErrorMessage(reason); + // stop spam output channel + // vscode.window.showErrorMessage(reason); }); } From 4a02815e70b3553164a547ab6f9587b5962c011f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Thu, 16 Nov 2023 18:24:59 +0100 Subject: [PATCH 30/32] exclude github directory --- tsconfig.json | 1 + 1 file changed, 1 insertion(+) diff --git a/tsconfig.json b/tsconfig.json index a51f8b1..65c1c8a 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -12,6 +12,7 @@ "strict": true }, "exclude": [ + ".github", "node_modules", ".vscode-test" ] From 29b875455963f8cc9bde404cccd8b86889e2fdfa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Thu, 16 Nov 2023 18:25:47 +0100 Subject: [PATCH 31/32] prepare for release 1.0.3 --- CHANGELOG.md | 7 +++++++ package.json | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd2c805..cdc64e0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Confluence Wiki Markup +## [1.0.3](https://github.com/denco/vscode-confluence-markup/releases/tag/1.0.3) + +- fix render emoticons and local image files +- render to valid html +- disable output channel log on disposed panel +- code cosmetic + ## [1.0.2](https://github.com/denco/vscode-confluence-markup/releases/tag/1.0.2) - add render tip, note, info and warning macros [he info, tip, note, and warning macros are not rendered](https://github.com/denco/vscode-confluence-markup/issues/41) diff --git a/package.json b/package.json index e391af8..ab3083c 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "confluence-markup", "displayName": "Confluence markup", - "version": "1.0.2", + "version": "1.0.3", "publisher": "denco", "description": "Confluence markup language support for Visual Studio Code", "keywords": [ From ead806eb7d71a55cfd96d2fbb2376a5ab8b76b3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Denis=20Baumg=C3=A4rtner?= Date: Thu, 16 Nov 2023 18:34:40 +0100 Subject: [PATCH 32/32] fix lint error --- src/extension.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/extension.ts b/src/extension.ts index ad9839f..1337d2b 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -38,7 +38,7 @@ function getRenderedContent(contentProvider: ConfluenceContentProvider, uri: vsc `; } - }, (reason) => { + }, () => { // stop spam output channel // vscode.window.showErrorMessage(reason); });