Skip to content

Commit

Permalink
All: Fixes #5245: Bump hightlight.js to v11.2 (#5278)
Browse files Browse the repository at this point in the history
  • Loading branch information
roman-r-m committed Aug 12, 2021
1 parent 11cf847 commit e57e5d3
Show file tree
Hide file tree
Showing 6 changed files with 24 additions and 31 deletions.
7 changes: 2 additions & 5 deletions 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';
Expand Down Expand Up @@ -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('');
Expand Down
4 changes: 2 additions & 2 deletions packages/app-cli/tests/md_to_html/code_block.html
@@ -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() {
console.info('bonjour');
}</pre><pre class="hljs"><code><span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>) </span>{
<span class="hljs-built_in">console</span>.info(<span class="hljs-string">&#x27;bonjour&#x27;</span>);
}</pre><pre class="hljs"><code><span class="hljs-keyword">function</span>(<span class="hljs-params"></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>
Expand Up @@ -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;
}
Expand Down Expand Up @@ -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 {
Expand Down
16 changes: 7 additions & 9 deletions packages/renderer/assets/highlight.js/atom-one-light.css
Expand Up @@ -19,9 +19,6 @@ hue-6-2: #c18401
*/

.hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
color: #383a42;
background: #fafafa;
}
Expand Down Expand Up @@ -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,
Expand All @@ -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;
}
Expand Down
17 changes: 8 additions & 9 deletions packages/renderer/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion packages/renderer/package.json
Expand Up @@ -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",
Expand Down

0 comments on commit e57e5d3

Please sign in to comment.