1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

All: Fixes #5245: Bump hightlight.js to v11.2 (#5278)

This commit is contained in:
Roman Musin 2021-08-12 22:07:57 +01:00 committed by GitHub
parent 11cf8474f7
commit e57e5d3b3f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 24 additions and 31 deletions

View File

@ -1,5 +1,4 @@
import MdToHtml from '@joplin/renderer/MdToHtml'; import MdToHtml from '@joplin/renderer/MdToHtml';
const os = require('os');
const { filename } = require('@joplin/lib/path-utils'); const { filename } = require('@joplin/lib/path-utils');
import { setupDatabaseAndSynchronizer, switchClient } from '@joplin/lib/testing/test-utils'; import { setupDatabaseAndSynchronizer, switchClient } from '@joplin/lib/testing/test-utils';
import shim from '@joplin/lib/shim'; import shim from '@joplin/lib/shim';
@ -57,10 +56,8 @@ describe('MdToHtml', function() {
const result = await mdToHtml.render(markdown, null, mdToHtmlOptions); const result = await mdToHtml.render(markdown, null, mdToHtmlOptions);
let actualHtml = result.html; let actualHtml = result.html;
if (os.EOL === '\r\n') { expectedHtml = expectedHtml.replace(/\r?\n/g, '\n');
expectedHtml = expectedHtml.replace(/\r\n/g, '\n'); actualHtml = actualHtml.replace(/\r?\n/g, '\n');
actualHtml = actualHtml.replace(/\r\n/g, '\n');
}
if (actualHtml !== expectedHtml) { if (actualHtml !== expectedHtml) {
console.info(''); console.info('');

View File

@ -1,5 +1,5 @@
<div class="joplin-editable"><pre class="joplin-source" data-joplin-language="javascript" data-joplin-source-open="```javascript&#10;" data-joplin-source-close="&#10;```">function() { <div class="joplin-editable"><pre class="joplin-source" data-joplin-language="javascript" data-joplin-source-open="```javascript&#10;" data-joplin-source-close="&#10;```">function() {
console.info('bonjour'); console.info('bonjour');
}</pre><pre class="hljs"><code><span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{ }</pre><pre class="hljs"><code><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) {
<span class="hljs-built_in">console</span>.info(<span class="hljs-string">&#x27;bonjour&#x27;</span>); <span class="hljs-variable language_">console</span>.<span class="hljs-title function_">info</span>(<span class="hljs-string">&#x27;bonjour&#x27;</span>);
}</code></pre></div> }</code></pre></div>

View File

@ -6,9 +6,6 @@ Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax
*/ */
.hljs { .hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #abb2bf; color: #abb2bf;
background: #282c34; background: #282c34;
} }
@ -52,10 +49,12 @@ Original One Dark Syntax theme from https://github.com/atom/one-dark-syntax
.hljs-literal { .hljs-literal {
color: #56b6c2; 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; color: #98c379;
} }
.hljs-built_in, .hljs-class .hljs-title { .hljs-built_in,
.hljs-title.class_,
.hljs-class .hljs-title {
color: #e6c07b; color: #e6c07b;
} }
.hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-selector-class, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-number { .hljs-attr, .hljs-variable, .hljs-template-variable, .hljs-type, .hljs-selector-class, .hljs-selector-attr, .hljs-selector-pseudo, .hljs-number {

View File

@ -19,9 +19,6 @@ hue-6-2: #c18401
*/ */
.hljs { .hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #383a42; color: #383a42;
background: #fafafa; background: #fafafa;
} }
@ -54,15 +51,10 @@ hue-6-2: #c18401
.hljs-regexp, .hljs-regexp,
.hljs-addition, .hljs-addition,
.hljs-attribute, .hljs-attribute,
.hljs-meta-string { .hljs-meta .hljs-string {
color: #50a14f; color: #50a14f;
} }
.hljs-built_in,
.hljs-class .hljs-title {
color: #c18401;
}
.hljs-attr, .hljs-attr,
.hljs-variable, .hljs-variable,
.hljs-template-variable, .hljs-template-variable,
@ -83,6 +75,12 @@ hue-6-2: #c18401
color: #4078f2; color: #4078f2;
} }
.hljs-built_in,
.hljs-title.class_,
.hljs-class .hljs-title {
color: #c18401;
}
.hljs-emphasis { .hljs-emphasis {
font-style: italic; font-style: italic;
} }

View File

@ -11,7 +11,7 @@
"dependencies": { "dependencies": {
"font-awesome-filetypes": "^2.1.0", "font-awesome-filetypes": "^2.1.0",
"fs-extra": "^8.1.0", "fs-extra": "^8.1.0",
"highlight.js": "^10.2.1", "highlight.js": "^11.2.0",
"html-entities": "^1.2.1", "html-entities": "^1.2.1",
"json-stringify-safe": "^5.0.1", "json-stringify-safe": "^5.0.1",
"katex": "^0.13.3", "katex": "^0.13.3",
@ -3551,12 +3551,11 @@
} }
}, },
"node_modules/highlight.js": { "node_modules/highlight.js": {
"version": "10.2.1", "version": "11.2.0",
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.2.1.tgz", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.2.0.tgz",
"integrity": "sha512-A+sckVPIb9zQTUydC9lpRX1qRFO/N0OKEh0NwIr65ckvWA/oMY8v9P3+kGRK3w2ULSh9E8v5MszXafodQ6039g==", "integrity": "sha512-JOySjtOEcyG8s4MLR2MNbLUyaXqUunmSnL2kdV/KuGJOmHZuAR5xC54Ko7goAXBWNhf09Vy3B+U7vR62UZ/0iw==",
"deprecated": "Potential vulnerability. Please upgrade to @latest",
"engines": { "engines": {
"node": "*" "node": ">=12.0.0"
} }
}, },
"node_modules/hosted-git-info": { "node_modules/hosted-git-info": {
@ -11519,9 +11518,9 @@
"integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw=="
}, },
"highlight.js": { "highlight.js": {
"version": "10.2.1", "version": "11.2.0",
"resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.2.1.tgz", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-11.2.0.tgz",
"integrity": "sha512-A+sckVPIb9zQTUydC9lpRX1qRFO/N0OKEh0NwIr65ckvWA/oMY8v9P3+kGRK3w2ULSh9E8v5MszXafodQ6039g==" "integrity": "sha512-JOySjtOEcyG8s4MLR2MNbLUyaXqUunmSnL2kdV/KuGJOmHZuAR5xC54Ko7goAXBWNhf09Vy3B+U7vR62UZ/0iw=="
}, },
"hosted-git-info": { "hosted-git-info": {
"version": "2.8.9", "version": "2.8.9",

View File

@ -27,7 +27,7 @@
"@joplin/fork-htmlparser2": "^4.1.32", "@joplin/fork-htmlparser2": "^4.1.32",
"font-awesome-filetypes": "^2.1.0", "font-awesome-filetypes": "^2.1.0",
"fs-extra": "^8.1.0", "fs-extra": "^8.1.0",
"highlight.js": "^10.2.1", "highlight.js": "^11.2.0",
"html-entities": "^1.2.1", "html-entities": "^1.2.1",
"json-stringify-safe": "^5.0.1", "json-stringify-safe": "^5.0.1",
"katex": "^0.13.3", "katex": "^0.13.3",