mirror of
https://github.com/outline/outline.git
synced 2026-02-25 14:00:27 -06:00
fix: Add syntax highlighting for Mermaid diagrams
This commit is contained in:
@@ -307,7 +307,7 @@
|
||||
"@types/react-window": "^1.8.8",
|
||||
"@types/readable-stream": "^4.0.15",
|
||||
"@types/redis-info": "^3.0.3",
|
||||
"@types/refractor": "^3.4.0",
|
||||
"@types/refractor": "^3.4.1",
|
||||
"@types/resolve-path": "^1.4.2",
|
||||
"@types/semver": "^7.5.8",
|
||||
"@types/sequelize": "^4.28.20",
|
||||
|
||||
@@ -108,7 +108,11 @@ function getDecorations({
|
||||
|
||||
blocks.forEach((block) => {
|
||||
let startPos = block.pos + 1;
|
||||
const language = block.node.attrs.language;
|
||||
const language = (
|
||||
block.node.attrs.language === "mermaidjs"
|
||||
? "mermaid"
|
||||
: block.node.attrs.language
|
||||
) as string;
|
||||
if (!language || language === "none" || !refractor.registered(language)) {
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -32,6 +32,8 @@ import kotlin from "refractor/lang/kotlin";
|
||||
import lisp from "refractor/lang/lisp";
|
||||
import lua from "refractor/lang/lua";
|
||||
import markup from "refractor/lang/markup";
|
||||
// @ts-expect-error type definition is missing, but package exists
|
||||
import mermaid from "refractor/lang/mermaid";
|
||||
import nginx from "refractor/lang/nginx";
|
||||
import nix from "refractor/lang/nix";
|
||||
import objectivec from "refractor/lang/objectivec";
|
||||
@@ -109,6 +111,7 @@ const DEFAULT_LANGUAGE = "javascript";
|
||||
lisp,
|
||||
lua,
|
||||
markup,
|
||||
mermaid,
|
||||
nginx,
|
||||
nix,
|
||||
objectivec,
|
||||
|
||||
@@ -4972,10 +4972,10 @@
|
||||
resolved "https://registry.yarnpkg.com/@types/redis-info/-/redis-info-3.0.3.tgz#4963fa015a6b448d9c7e27d6cba96d5db7201550"
|
||||
integrity "sha1-SWP6AVprRI2cfifWy6ltXbcgFVA= sha512-VIkNy6JbYI/RLdbPHdm9JQvv6RVld2uE2/6Hdid38Qdq+zvDli2FTpImI8pC5zwp8xS8qVqfzlfyAub8xZEd5g=="
|
||||
|
||||
"@types/refractor@^3.4.0":
|
||||
version "3.4.0"
|
||||
resolved "https://registry.yarnpkg.com/@types/refractor/-/refractor-3.4.0.tgz#7a8f982e100d3319ee0e8f93a088d093cd145a21"
|
||||
integrity "sha1-eo+YLhANMxnuDo+ToIjQk80UWiE= sha512-ZVLDkJxBQgvulG7R+xzgsJVODJVr0hlpCiMnEcxeJwCIzCSUwCHrsuQmd9KGZm//ujeuV9WHiVGUawaZkLLJrQ=="
|
||||
"@types/refractor@^3.4.1":
|
||||
version "3.4.1"
|
||||
resolved "https://registry.yarnpkg.com/@types/refractor/-/refractor-3.4.1.tgz#8b109804f77b3da8fad543d3f575fef1ece8835a"
|
||||
integrity sha512-wYuorIiCTSuvRT9srwt+taF6mH/ww+SyN2psM0sjef2qW+sS8GmshgDGTEDgWB1sTVGgYVE6EK7dBA2MxQxibg==
|
||||
dependencies:
|
||||
"@types/prismjs" "*"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user