Skip to content
This repository has been archived by the owner on Jan 20, 2022. It is now read-only.

fix: allow / to be used anywhere, not just a new line #414

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 1 addition & 6 deletions src/plugins/BlockMenuTrigger.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import { InputRule } from "prosemirror-inputrules";
import ReactDOM from "react-dom";
import * as React from "react";
import { Plugin } from "prosemirror-state";
import { isInTable } from "prosemirror-tables";
import { findParentNode } from "prosemirror-utils";
import { PlusIcon } from "outline-icons";
import { Decoration, DecorationSet } from "prosemirror-view";
Expand Down Expand Up @@ -158,11 +157,7 @@ export default class BlockMenuTrigger extends Extension {
// main regex should match only:
// /word
new InputRule(OPEN_REGEX, (state, match) => {
if (
match &&
state.selection.$from.parent.type.name === "paragraph" &&
!isInTable(state)
) {
if (match) {
this.options.onOpen(match[1]);
}
return null;
Expand Down