diff --git a/packages/app-cli/tests/MdToHtml.ts b/packages/app-cli/tests/MdToHtml.ts index 8c69d6b11..3736e223f 100644 --- a/packages/app-cli/tests/MdToHtml.ts +++ b/packages/app-cli/tests/MdToHtml.ts @@ -1,5 +1,4 @@ import MdToHtml from '@joplin/renderer/MdToHtml'; -const os = require('os'); const { filename } = require('@joplin/lib/path-utils'); import { setupDatabaseAndSynchronizer, switchClient } from '@joplin/lib/testing/test-utils'; import shim from '@joplin/lib/shim'; @@ -57,10 +56,8 @@ describe('MdToHtml', function() { const result = await mdToHtml.render(markdown, null, mdToHtmlOptions); let actualHtml = result.html; - if (os.EOL === '\r\n') { - expectedHtml = expectedHtml.replace(/\r\n/g, '\n'); - actualHtml = actualHtml.replace(/\r\n/g, '\n'); - } + expectedHtml = expectedHtml.replace(/\r?\n/g, '\n'); + actualHtml = actualHtml.replace(/\r?\n/g, '\n'); if (actualHtml !== expectedHtml) { console.info(''); diff --git a/packages/app-cli/tests/md_to_html/code_block.html b/packages/app-cli/tests/md_to_html/code_block.html index 24372e8bf..7715d1455 100644 --- a/packages/app-cli/tests/md_to_html/code_block.html +++ b/packages/app-cli/tests/md_to_html/code_block.html @@ -1,5 +1,5 @@
function() {
     console.info('bonjour');
-}
function() {
-    console.info('bonjour');
+}
function() {
+    console.info('bonjour');
 }
diff --git a/packages/renderer/assets/highlight.js/atom-one-dark-reasonable.css b/packages/renderer/assets/highlight.js/atom-one-dark-reasonable.css index 0a43fe26b..a38738d96 100644 --- a/packages/renderer/assets/highlight.js/atom-one-dark-reasonable.css +++ b/packages/renderer/assets/highlight.js/atom-one-dark-reasonable.css @@ -6,9 +6,6 @@ Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax */ .hljs { - display: block; - overflow-x: auto; - padding: 0.5em; color: #abb2bf; background: #282c34; } @@ -52,10 +49,12 @@ Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax .hljs-literal { color: #56b6c2; } -.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta-string { +.hljs-string, .hljs-regexp, .hljs-addition, .hljs-attribute, .hljs-meta .hljs-string { color: #98c379; } -.hljs-built_in, .hljs-class .hljs-title { +.hljs-built_in, +.hljs-title.class_, +.hljs-class .hljs-title { color: #e6c07b; } .hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-selector-class, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-number { diff --git a/packages/renderer/assets/highlight.js/atom-one-light.css b/packages/renderer/assets/highlight.js/atom-one-light.css index d5bd1d2a9..4ae2c63f8 100644 --- a/packages/renderer/assets/highlight.js/atom-one-light.css +++ b/packages/renderer/assets/highlight.js/atom-one-light.css @@ -19,9 +19,6 @@ hue-6-2: #c18401 */ .hljs { - display: block; - overflow-x: auto; - padding: 0.5em; color: #383a42; background: #fafafa; } @@ -54,15 +51,10 @@ hue-6-2: #c18401 .hljs-regexp, .hljs-addition, .hljs-attribute, -.hljs-meta-string { +.hljs-meta .hljs-string { color: #50a14f; } -.hljs-built_in, -.hljs-class .hljs-title { - color: #c18401; -} - .hljs-attr, .hljs-variable, .hljs-template-variable, @@ -83,6 +75,12 @@ hue-6-2: #c18401 color: #4078f2; } +.hljs-built_in, +.hljs-title.class_, +.hljs-class .hljs-title { + color: #c18401; +} + .hljs-emphasis { font-style: italic; } diff --git a/packages/renderer/package-lock.json b/packages/renderer/package-lock.json index 2a60366f1..05a6a3208 100644 --- a/packages/renderer/package-lock.json +++ b/packages/renderer/package-lock.json @@ -11,7 +11,7 @@ "dependencies": { "font-awesome-filetypes": "^2.1.0", "fs-extra": "^8.1.0", - "highlight.js": "^10.2.1", + "highlight.js": "^11.2.0", "html-entities": "^1.2.1", "json-stringify-safe": "^5.0.1", "katex": "^0.13.3", @@ -3551,12 +3551,11 @@ } }, "node_modules/highlight.js": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.2.1.tgz", - "integrity": "sha512-A+sckVPIb9zQTUydC9lpRX1qRFO/N0OKEh0NwIr65ckvWA/oMY8v9P3+kGRK3w2ULSh9E8v5MszXafodQ6039g==", - "deprecated": "Potential vulnerability. Please upgrade to @latest", + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.2.0.tgz", + "integrity": "sha512-JOySjtOEcyG8s4MLR2MNbLUyaXqUunmSnL2kdV/KuGJOmHZuAR5xC54Ko7goAXBWNhf09Vy3B+U7vR62UZ/0iw==", "engines": { - "node": "*" + "node": ">=12.0.0" } }, "node_modules/hosted-git-info": { @@ -11519,9 +11518,9 @@ "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" }, "highlight.js": { - "version": "10.2.1", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.2.1.tgz", - "integrity": "sha512-A+sckVPIb9zQTUydC9lpRX1qRFO/N0OKEh0NwIr65ckvWA/oMY8v9P3+kGRK3w2ULSh9E8v5MszXafodQ6039g==" + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.2.0.tgz", + "integrity": "sha512-JOySjtOEcyG8s4MLR2MNbLUyaXqUunmSnL2kdV/KuGJOmHZuAR5xC54Ko7goAXBWNhf09Vy3B+U7vR62UZ/0iw==" }, "hosted-git-info": { "version": "2.8.9", diff --git a/packages/renderer/package.json b/packages/renderer/package.json index 08306f41d..adf84b6d7 100644 --- a/packages/renderer/package.json +++ b/packages/renderer/package.json @@ -27,7 +27,7 @@ "@joplin/fork-htmlparser2": "^4.1.32", "font-awesome-filetypes": "^2.1.0", "fs-extra": "^8.1.0", - "highlight.js": "^10.2.1", + "highlight.js": "^11.2.0", "html-entities": "^1.2.1", "json-stringify-safe": "^5.0.1", "katex": "^0.13.3",