diff options
author | Olivier Hallot <olivier.hallot@libreoffice.org> | 2022-05-14 13:27:28 -0300 |
---|---|---|
committer | Olivier Hallot <olivier.hallot@libreoffice.org> | 2022-05-14 18:39:51 +0200 |
commit | 789bc6e2c10536e5a876c5c4fb0126dbffe4dcbf (patch) | |
tree | 5696c96b6afd42e5382dfd7ee7a8a5355d9ba8fb /help3xsl | |
parent | 5c82eb12e524d454c02798994d08d50548c9734c (diff) |
Bump Prism.js to 1.28
+ Add SQL coloring syntax
Change-Id: I3a68a54dee211d791da72b459647315395e17658
Reviewed-on: https://gerrit.libreoffice.org/c/help/+/134326
Tested-by: Jenkins
Reviewed-by: Olivier Hallot <olivier.hallot@libreoffice.org>
Diffstat (limited to 'help3xsl')
-rw-r--r-- | help3xsl/README.prism.js.txt | 12 | ||||
-rw-r--r-- | help3xsl/prism.css | 4 | ||||
-rw-r--r-- | help3xsl/prism.js | 44 |
3 files changed, 50 insertions, 10 deletions
diff --git a/help3xsl/README.prism.js.txt b/help3xsl/README.prism.js.txt index 2f3f004b6b..96a42aa130 100644 --- a/help3xsl/README.prism.js.txt +++ b/help3xsl/README.prism.js.txt @@ -1,6 +1,6 @@ Latest download version -PrismJS 1.27.0 +PrismJS 1.28.0 Using prism.js for Basic code highlight @@ -12,10 +12,14 @@ Download page http://prismjs.com/download Theme: Coy -Languages to download: Visual Basic + Python + defaults pre-sets - -Plugins: line numbers, +Languages to download: +Visual Basic + +Python + +SQL + +defaults Prism pre-sets +Plugins: +line numbers, normalize-whitespace: configure after https://prismjs.com/plugins/normalize-whitespace/ Prism.plugins.NormalizeWhitespace = new NormalizeWhitespace({ diff --git a/help3xsl/prism.css b/help3xsl/prism.css index 79d07d18a1..4610909810 100644 --- a/help3xsl/prism.css +++ b/help3xsl/prism.css @@ -1,5 +1,5 @@ -/* PrismJS 1.27.0 -https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+python+visual-basic&plugins=line-numbers+normalize-whitespace */ +/* PrismJS 1.28.0 +https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+python+sql+visual-basic&plugins=line-numbers+normalize-whitespace */ /** * prism.js Coy theme for JavaScript, CoffeeScript, CSS and HTML * Based on https://github.com/tshedor/workshop-wp-theme (Example: http://workshop.kansan.com/category/sessions/basics or http://workshop.timshedor.com/category/sessions/basics); diff --git a/help3xsl/prism.js b/help3xsl/prism.js index 4e00aeb045..6ed3825908 100644 --- a/help3xsl/prism.js +++ b/help3xsl/prism.js @@ -1,5 +1,5 @@ -/* PrismJS 1.27.0 -https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+python+visual-basic&plugins=line-numbers+normalize-whitespace */ +/* PrismJS 1.28.0 +https://prismjs.com/download.html#themes=prism-coy&languages=markup+css+clike+javascript+python+sql+visual-basic&plugins=line-numbers+normalize-whitespace */ /// <reference lib="WebWorker"/> var _self = (typeof window !== 'undefined') @@ -1317,7 +1317,10 @@ Prism.languages.markup = { pattern: /^=/, alias: 'attr-equals' }, - /"|'/ + { + pattern: /^(\s*)["']|["']$/, + lookbehind: true + } ] } }, @@ -1455,7 +1458,7 @@ Prism.languages.rss = Prism.languages.xml; Prism.languages.css = { 'comment': /\/\*[\s\S]*?\*\//, 'atrule': { - pattern: /@[\w-](?:[^;{\s]|\s+(?![\s{]))*(?:;|(?=\s*\{))/, + pattern: RegExp('@[\\w-](?:' + /[^;{\s"']|\s+(?!\s)/.source + '|' + string.source + ')*?' + /(?:;|(?=\s*\{))/.source), inside: { 'rule': /^@[\w-]+/, 'selector-function-argument': { @@ -1784,6 +1787,39 @@ Prism.languages.python['string-interpolation'].inside['interpolation'].inside.re Prism.languages.py = Prism.languages.python; +Prism.languages.sql = { + 'comment': { + pattern: /(^|[^\\])(?:\/\*[\s\S]*?\*\/|(?:--|\/\/|#).*)/, + lookbehind: true + }, + 'variable': [ + { + pattern: /@(["'`])(?:\\[\s\S]|(?!\1)[^\\])+\1/, + greedy: true + }, + /@[\w.$]+/ + ], + 'string': { + pattern: /(^|[^@\\])("|')(?:\\[\s\S]|(?!\2)[^\\]|\2\2)*\2/, + greedy: true, + lookbehind: true + }, + 'identifier': { + pattern: /(^|[^@\\])`(?:\\[\s\S]|[^`\\]|``)*`/, + greedy: true, + lookbehind: true, + inside: { + 'punctuation': /^`|`$/ + } + }, + 'function': /\b(?:AVG|COUNT|FIRST|FORMAT|LAST|LCASE|LEN|MAX|MID|MIN|MOD|NOW|ROUND|SUM|UCASE)(?=\s*\()/i, // Should we highlight user defined functions too? + 'keyword': /\b(?:ACTION|ADD|AFTER|ALGORITHM|ALL|ALTER|ANALYZE|ANY|APPLY|AS|ASC|AUTHORIZATION|AUTO_INCREMENT|BACKUP|BDB|BEGIN|BERKELEYDB|BIGINT|BINARY|BIT|BLOB|BOOL|BOOLEAN|BREAK|BROWSE|BTREE|BULK|BY|CALL|CASCADED?|CASE|CHAIN|CHAR(?:ACTER|SET)?|CHECK(?:POINT)?|CLOSE|CLUSTERED|COALESCE|COLLATE|COLUMNS?|COMMENT|COMMIT(?:TED)?|COMPUTE|CONNECT|CONSISTENT|CONSTRAINT|CONTAINS(?:TABLE)?|CONTINUE|CONVERT|CREATE|CROSS|CURRENT(?:_DATE|_TIME|_TIMESTAMP|_USER)?|CURSOR|CYCLE|DATA(?:BASES?)?|DATE(?:TIME)?|DAY|DBCC|DEALLOCATE|DEC|DECIMAL|DECLARE|DEFAULT|DEFINER|DELAYED|DELETE|DELIMITERS?|DENY|DESC|DESCRIBE|DETERMINISTIC|DISABLE|DISCARD|DISK|DISTINCT|DISTINCTROW|DISTRIBUTED|DO|DOUBLE|DROP|DUMMY|DUMP(?:FILE)?|DUPLICATE|ELSE(?:IF)?|ENABLE|ENCLOSED|END|ENGINE|ENUM|ERRLVL|ERRORS|ESCAPED?|EXCEPT|EXEC(?:UTE)?|EXISTS|EXIT|EXPLAIN|EXTENDED|FETCH|FIELDS|FILE|FILLFACTOR|FIRST|FIXED|FLOAT|FOLLOWING|FOR(?: EACH ROW)?|FORCE|FOREIGN|FREETEXT(?:TABLE)?|FROM|FULL|FUNCTION|GEOMETRY(?:COLLECTION)?|GLOBAL|GOTO|GRANT|GROUP|HANDLER|HASH|HAVING|HOLDLOCK|HOUR|IDENTITY(?:COL|_INSERT)?|IF|IGNORE|IMPORT|INDEX|INFILE|INNER|INNODB|INOUT|INSERT|INT|INTEGER|INTERSECT|INTERVAL|INTO|INVOKER|ISOLATION|ITERATE|JOIN|KEYS?|KILL|LANGUAGE|LAST|LEAVE|LEFT|LEVEL|LIMIT|LINENO|LINES|LINESTRING|LOAD|LOCAL|LOCK|LONG(?:BLOB|TEXT)|LOOP|MATCH(?:ED)?|MEDIUM(?:BLOB|INT|TEXT)|MERGE|MIDDLEINT|MINUTE|MODE|MODIFIES|MODIFY|MONTH|MULTI(?:LINESTRING|POINT|POLYGON)|NATIONAL|NATURAL|NCHAR|NEXT|NO|NONCLUSTERED|NULLIF|NUMERIC|OFF?|OFFSETS?|ON|OPEN(?:DATASOURCE|QUERY|ROWSET)?|OPTIMIZE|OPTION(?:ALLY)?|ORDER|OUT(?:ER|FILE)?|OVER|PARTIAL|PARTITION|PERCENT|PIVOT|PLAN|POINT|POLYGON|PRECEDING|PRECISION|PREPARE|PREV|PRIMARY|PRINT|PRIVILEGES|PROC(?:EDURE)?|PUBLIC|PURGE|QUICK|RAISERROR|READS?|REAL|RECONFIGURE|REFERENCES|RELEASE|RENAME|REPEAT(?:ABLE)?|REPLACE|REPLICATION|REQUIRE|RESIGNAL|RESTORE|RESTRICT|RETURN(?:ING|S)?|REVOKE|RIGHT|ROLLBACK|ROUTINE|ROW(?:COUNT|GUIDCOL|S)?|RTREE|RULE|SAVE(?:POINT)?|SCHEMA|SECOND|SELECT|SERIAL(?:IZABLE)?|SESSION(?:_USER)?|SET(?:USER)?|SHARE|SHOW|SHUTDOWN|SIMPLE|SMALLINT|SNAPSHOT|SOME|SONAME|SQL|START(?:ING)?|STATISTICS|STATUS|STRIPED|SYSTEM_USER|TABLES?|TABLESPACE|TEMP(?:ORARY|TABLE)?|TERMINATED|TEXT(?:SIZE)?|THEN|TIME(?:STAMP)?|TINY(?:BLOB|INT|TEXT)|TOP?|TRAN(?:SACTIONS?)?|TRIGGER|TRUNCATE|TSEQUAL|TYPES?|UNBOUNDED|UNCOMMITTED|UNDEFINED|UNION|UNIQUE|UNLOCK|UNPIVOT|UNSIGNED|UPDATE(?:TEXT)?|USAGE|USE|USER|USING|VALUES?|VAR(?:BINARY|CHAR|CHARACTER|YING)|VIEW|WAITFOR|WARNINGS|WHEN|WHERE|WHILE|WITH(?: ROLLUP|IN)?|WORK|WRITE(?:TEXT)?|YEAR)\b/i, + 'boolean': /\b(?:FALSE|NULL|TRUE)\b/i, + 'number': /\b0x[\da-f]+\b|\b\d+(?:\.\d*)?|\B\.\d+\b/i, + 'operator': /[-+*\/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?|\b(?:AND|BETWEEN|DIV|ILIKE|IN|IS|LIKE|NOT|OR|REGEXP|RLIKE|SOUNDS LIKE|XOR)\b/i, + 'punctuation': /[;[\]()`,.]/ +}; + Prism.languages['visual-basic'] = { 'comment': { pattern: /(?:['‘’]|REM\b)(?:[^\r\n_]|_(?:\r\n?|\n)?)*/i, |