1
0
Fork 0
mirror of https://github.com/codex-team/codex.docs.git synced 2025-08-08 15:05:26 +02:00

Updated highlight.js

This commit is contained in:
nvc8996 2021-07-24 15:29:54 +03:00
parent 180e1d57cb
commit ec7d17dfdc
10 changed files with 45 additions and 29 deletions

View file

@ -4,6 +4,7 @@
"bin": {
"generatePassword": "bin/generatePassword.js"
},
"browserslist": ["last 2 versions", "> 1%"],
"scripts": {
"start": "cross-env NODE_ENV=production nodemon ./bin/www",
"start:dev": "cross-env NODE_ENV=development nodemon ./bin/www",
@ -72,7 +73,7 @@
"eslint-plugin-import": "^2.14.0",
"eslint-plugin-node": "^8.0.1",
"eslint-plugin-standard": "^4.0.0",
"highlight.js": "^10.4.1",
"highlight.js": "^11.1.0",
"husky": "^1.1.2",
"mini-css-extract-plugin": "^0.4.3",
"mocha": "^5.2.0",

File diff suppressed because one or more lines are too long

View file

@ -1,2 +1,11 @@
.hljs{display:block;background:#fff;padding:.5em;color:#333;overflow-x:auto}.hljs-comment,.hljs-meta{color:#969896}.hljs-emphasis,.hljs-quote,.hljs-strong,.hljs-template-variable,.hljs-variable{color:#df5000}.hljs-keyword,.hljs-selector-tag,.hljs-type{color:#d73a49}.hljs-attribute,.hljs-bullet,.hljs-literal,.hljs-symbol{color:#0086b3}.hljs-name,.hljs-section{color:#63a35c}.hljs-tag{color:#333}.hljs-attr,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-selector-pseudo,.hljs-title{color:#6f42c1}.hljs-addition{color:#55a532;background-color:#eaffea}.hljs-deletion{color:#bd2c00;background-color:#ffecec}.hljs-link{text-decoration:underline}.hljs-number{color:#005cc5}.hljs-string{color:#032f62}
/*!
Theme: GitHub
Description: Light theme as seen on github.com
Author: github.com
Maintainer: @Hirse
Updated: 2021-05-15
Outdated base version: https://github.com/primer/github-syntax-light
Current colors taken from GitHub's CSS
*/.hljs{color:#24292e;background:#fff}.hljs-doctag,.hljs-keyword,.hljs-meta .hljs-keyword,.hljs-template-tag,.hljs-template-variable,.hljs-type,.hljs-variable.language_{color:#d73a49}.hljs-title,.hljs-title.class_,.hljs-title.class_.inherited__,.hljs-title.function_{color:#6f42c1}.hljs-attr,.hljs-attribute,.hljs-literal,.hljs-meta,.hljs-number,.hljs-operator,.hljs-selector-attr,.hljs-selector-class,.hljs-selector-id,.hljs-variable{color:#005cc5}.hljs-meta .hljs-string,.hljs-regexp,.hljs-string{color:#032f62}.hljs-built_in,.hljs-symbol{color:#e36209}.hljs-code,.hljs-comment,.hljs-formula{color:#6a737d}.hljs-name,.hljs-quote,.hljs-selector-pseudo,.hljs-selector-tag{color:#22863a}.hljs-subst{color:#24292e}.hljs-section{color:#005cc5;font-weight:700}.hljs-bullet{color:#735c0f}.hljs-emphasis{color:#24292e;font-style:italic}.hljs-strong{color:#24292e;font-weight:700}.hljs-addition{color:#22863a;background-color:#f0fff4}.hljs-deletion{color:#b31d28;background-color:#ffeef0}
.diff{display:inline-block;width:100%}.diff span{color:inherit!important}.diff--added{color:#277030;background-color:#e2fce7}.diff--added:before{content:"+";opacity:.4}.diff--removed{color:#ae363c;background-color:#ffe6e6}.diff--removed:before{content:"-";opacity:.4}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -12,5 +12,4 @@ plugins:
postcss-color-hex-alpha: {}
postcss-font-family-system-ui: {}
cssnano: {}
autoprefixer:
browsers: ['last 2 versions', '> 1%']

View file

@ -1,9 +1,9 @@
import hljs from 'highlight.js/lib/highlight';
import hljs from 'highlight.js/lib/common';
import javascript from 'highlight.js/lib/languages/javascript';
import xml from 'highlight.js/lib/languages/xml';
import json from 'highlight.js/lib/languages/json';
import css from 'highlight.js/lib/languages/css';
import style from 'highlight.js/styles/github-gist.css'; // eslint-disable-line no-unused-vars
import style from 'highlight.js/styles/github.css'; // eslint-disable-line no-unused-vars
import diffStyles from '../../styles/diff.pcss'; // eslint-disable-line no-unused-vars
/**
@ -22,7 +22,7 @@ export default class CodeStyler {
javascript,
xml,
json,
css
css,
};
this.init();
@ -43,7 +43,7 @@ export default class CodeStyler {
});
hljs.configure({
languages: this.languages
languages: this.languages,
});
Array.from(codeBlocks).forEach(block => {
@ -56,8 +56,8 @@ export default class CodeStyler {
* Highlight lines started from + or -
* @param {Element} block
*/
highlightDiffs(block){
let lines = block.innerHTML.split('\n').map((line, index) => {
highlightDiffs(block) {
const lines = block.innerHTML.split('\n').map((line, index) => {
return line.replace(/^\+(.*)$/ig, '<span class="diff diff--added">$1</span>')
.replace(/^-(.*)$/ig, '<span class="diff diff--removed">$1</span>');
});

View file

@ -10,8 +10,7 @@ export default class Extensions {
*/
constructor() {
this.misprints = new Misprints({
chatId: window.config.misprintsChatId
chatId: window.config.misprintsChatId,
});
}
}

View file

@ -721,6 +721,7 @@
"@editorjs/code@^2.7.0":
version "2.7.0"
resolved "https://registry.yarnpkg.com/@editorjs/code/-/code-2.7.0.tgz#0a21de9ac15e4533605ffcc80969513ab2142ac5"
integrity sha512-gXtTce915fHp3H9i4IqhTxEDbbkT2heFfYiW/bhFHsCmZDpyGzfZxi94kmrEqDmbxXjV49ZZ6GZbR26If13KJw==
"@editorjs/delimiter@^1.2.0":
version "1.2.0"
@ -729,6 +730,7 @@
"@editorjs/editorjs@^2.22.2":
version "2.22.2"
resolved "https://registry.yarnpkg.com/@editorjs/editorjs/-/editorjs-2.22.2.tgz#bf1d10c9fa9dd1dc574c18d8f4b77fef43d8e7f6"
integrity sha512-rPCv7Z5LZebreQaaL4DZuWzoVGEqwB+P7BF1dsefGQNBmLyeLF412topeW2b6e+g4l1oQ7t75kCOACNTEyYYIA==
dependencies:
codex-notifier "^1.1.2"
codex-tooltip "^1.0.2"
@ -737,6 +739,7 @@
"@editorjs/header@^2.6.1":
version "2.6.1"
resolved "https://registry.yarnpkg.com/@editorjs/header/-/header-2.6.1.tgz#454a46e4dbb32ae3aa1db4d22b0ddf2cc36c3134"
integrity sha512-EsnyVFv5uThpU9tbQ/dUPFCQoa/sBFy2n+9tN3wOXJGx7sjea4fdcacJ2UYhO+7pCgZ+aSgmMOyGLYHUFbchvA==
"@editorjs/image@^2.6.0":
version "2.6.0"
@ -755,6 +758,7 @@
"@editorjs/list@^1.6.2":
version "1.6.2"
resolved "https://registry.yarnpkg.com/@editorjs/list/-/list-1.6.2.tgz#38cb307d78ec8b6c55480c538805cdc2ff250ad1"
integrity sha512-OxowV0yuE11G01czYM1dEQlz1F37ehX0ak5vAbZ9ncSXrPh0fDRw/fBxTY654FlmrsQ40UFom3owSG++tLvVGw==
"@editorjs/marker@^1.2.2":
version "1.2.2"
@ -767,6 +771,7 @@
"@editorjs/table@^2.0.1":
version "2.0.1"
resolved "https://registry.yarnpkg.com/@editorjs/table/-/table-2.0.1.tgz#ec7726b7b662ed4ddbcd023e9a4644fbb6ea73b8"
integrity sha512-PB8VM+GPRwGy7IlF+WrEQw2A2c36xEXBnYIvf2VGNJo8A7PjYHtuWrlyHHCnGpY4lHXYnavZ/U8pKAfXv86XjA==
"@editorjs/warning@^1.2.0":
version "1.2.0"
@ -1659,8 +1664,8 @@ caniuse-api@^3.0.0:
lodash.uniq "^4.5.0"
caniuse-lite@^1.0.0, caniuse-lite@^1.0.30000655, caniuse-lite@^1.0.30001093, caniuse-lite@^1.0.30001097:
version "1.0.30001107"
resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001107.tgz#809360df7a5b3458f627aa46b0f6ed6d5239da9a"
version "1.0.30001247"
resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001247.tgz"
capture-stack-trace@^1.0.0:
version "1.0.1"
@ -1858,6 +1863,7 @@ codex-notifier@^1.1.2:
codex-tooltip@^1.0.2:
version "1.0.2"
resolved "https://registry.yarnpkg.com/codex-tooltip/-/codex-tooltip-1.0.2.tgz#81a9d3e2937658c6e5312106b47b9f094ff7be63"
integrity sha512-oC+Bu5X/zyhbPydgMSLWKoM/+vkJMqaLWu3Dt/jZgXS3MWK23INwC5DMBrVXZSufAFk0i0SUni38k9rLMyZn/w==
collection-visit@^1.0.0:
version "1.0.0"
@ -3489,9 +3495,10 @@ hex-color-regex@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/hex-color-regex/-/hex-color-regex-1.1.0.tgz#4c06fccb4602fe2602b3c93df82d7e7dbf1a8a8e"
highlight.js@^10.4.1:
version "10.4.1"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.4.1.tgz#d48fbcf4a9971c4361b3f95f302747afe19dbad0"
highlight.js@^11.1.0:
version "11.1.0"
resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.1.0.tgz#0198f7326e64ddfbea5f76b00e84ab542cf24ae8"
integrity sha512-X9VVhYKHQPPuwffO8jk4bP/FVj+ibNCy3HxZZNDXFtJrq4O5FdcdCDRIkDis5MiMnjh7UwEdHgRZJcHFYdzDdA==
hmac-drbg@^1.0.1:
version "1.0.1"
@ -4646,6 +4653,7 @@ nan@^2.12.1:
nanoid@^3.1.22:
version "3.1.23"
resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.23.tgz#f744086ce7c2bc47ee0a8472574d5c78e4183a81"
integrity sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw==
nanomatch@^1.2.9:
version "1.2.13"