mirror of https://github.com/fantasticit/think.git
tiptap: update input rule
This commit is contained in:
parent
3bd5d1180c
commit
32fdf58f42
|
@ -69,7 +69,7 @@ export const Callout = Node.create({
|
|||
addInputRules() {
|
||||
return [
|
||||
wrappingInputRule({
|
||||
find: /^\$callout $/,
|
||||
find: /^\$callout\$$/,
|
||||
type: this.type,
|
||||
getAttributes: (match) => {
|
||||
return { type: match[1] };
|
||||
|
|
|
@ -268,7 +268,7 @@ export const Columns = Node.create({
|
|||
addInputRules() {
|
||||
return [
|
||||
nodeInputRule({
|
||||
find: /^\$columns $/,
|
||||
find: /^\$columns\$$/,
|
||||
type: this.type,
|
||||
getAttributes: () => {
|
||||
return { type: 'left-right', columns: 2 };
|
||||
|
|
|
@ -78,7 +78,7 @@ export const Countdown = Node.create({
|
|||
addInputRules() {
|
||||
return [
|
||||
nodeInputRule({
|
||||
find: /^\$countdown $/,
|
||||
find: /^\$countdown\$$/,
|
||||
type: this.type,
|
||||
getAttributes: () => {
|
||||
return { width: '100%' };
|
||||
|
|
|
@ -103,7 +103,7 @@ export const Excalidraw = Node.create({
|
|||
addInputRules() {
|
||||
return [
|
||||
nodeInputRule({
|
||||
find: /^\$excalidraw $/,
|
||||
find: /^\$excalidraw\$$/,
|
||||
type: this.type,
|
||||
getAttributes: () => {
|
||||
return { width: '100%' };
|
||||
|
|
|
@ -108,7 +108,7 @@ export const Flow = Node.create<IFlowOptions>({
|
|||
addInputRules() {
|
||||
return [
|
||||
nodeInputRule({
|
||||
find: /^\$flow $/,
|
||||
find: /^\$flow\$$/,
|
||||
type: this.type,
|
||||
getAttributes: () => {
|
||||
return { width: '100%', defaultShowPicker: true, createUser: this.options.getCreateUserId() };
|
||||
|
|
|
@ -98,7 +98,7 @@ export const Iframe = Node.create({
|
|||
addInputRules() {
|
||||
return [
|
||||
nodeInputRule({
|
||||
find: /^\$iframe $/,
|
||||
find: /^\$iframe\$$/,
|
||||
type: this.type,
|
||||
getAttributes: () => {
|
||||
return { width: '100%' };
|
||||
|
|
|
@ -78,7 +78,7 @@ export const Katex = Node.create<IKatexOptions>({
|
|||
addInputRules() {
|
||||
return [
|
||||
nodeInputRule({
|
||||
find: /^\$katex $/,
|
||||
find: /^\$katex\$$/,
|
||||
type: this.type,
|
||||
getAttributes: () => {
|
||||
return { defaultShowPicker: true, createUser: this.options.getCreateUserId() };
|
||||
|
|
|
@ -83,7 +83,7 @@ const placeholders = [
|
|||
'使用 markdown 语法进行输入',
|
||||
'输入 @ 来提及他人',
|
||||
'输入 : 来插入表情',
|
||||
'你知道吗?输入 $katex 然后按一下空格就可以快速插入数学公式,其他节点操作类似哦',
|
||||
'你知道吗?输入 $katex 然后在输入一个 $ 就可以快速插入数学公式,其他节点操作类似哦',
|
||||
];
|
||||
|
||||
const getCreateUserId = () => safeJSONParse(window.localStorage.getItem('user')).id;
|
||||
|
|
Loading…
Reference in New Issue