diff --git a/.gitignore b/.gitignore index 1af58a97..b1e991ca 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,5 @@ node_modules devAssets .DS_Store -.idea \ No newline at end of file +.idea +result diff --git a/flake.nix b/flake.nix index a0d17826..a900e7c1 100644 --- a/flake.nix +++ b/flake.nix @@ -7,16 +7,17 @@ outputs = { self, nixpkgs, flake-utils }: flake-utils.lib.eachDefaultSystem (system: let pkgs = import nixpkgs { inherit system; }; - der = pkgs.stdenv.mkDerivation { + cinny = pkgs.buildNpmPackage { name = "cinny"; src = ./.; - buildInputs = [pkgs.nodejs_latest pkgs.nodePackages.pnpm]; - unpackPhase = "true"; - configurePhase = "pnpm install"; - buildPhase = "pnpm run build"; - installPhase = "mv dist $out"; + npmDepsHash = "sha256-E48xV3Lil7n4xxEeUpuiF8LEGkJc+GXRRK1TSbkOcgk="; + nativeBuildInputs = with pkgs; [ python3 pkg-config ]; + buildInputs = with pkgs; [ pixman cairo pango ]; + installPhase = '' + cp -r dist $out + ''; }; in { - packages.default = der; + packages.default = cinny; }); } diff --git a/src/app/components/editor/Editor.tsx b/src/app/components/editor/Editor.tsx index 1a41e54d..401bdb37 100644 --- a/src/app/components/editor/Editor.tsx +++ b/src/app/components/editor/Editor.tsx @@ -21,7 +21,7 @@ import { withHistory } from 'slate-history'; import { BlockType } from './types'; import { RenderElement } from './Elements'; import { CustomElement } from './slate'; -import { mdParser } from '../../../util/markdown'; +import { parseBlockMD, parseInlineMD } from '../../plugins/markdown'; import type { SingleASTNode } from '@khanacademy/simple-markdown'; import '../../molecules/markdown-input/MarkdownInput.scss'; import * as css from './Editor.css'; @@ -204,12 +204,9 @@ export const CustomEditor = forwardRef( // const emojis = getShortcodeToEmoji(this.matrixClient, [room, ...parentRooms]); - const content = mdParser(node.text, { - userNames: [], - emojis: {}, - }); + // const content = parseBlockMD(node.text, parseInlineMD); - addRanges(content); + // addRanges(content); // add final syntax range if (position < node.text.length) {