update: block 插件markdown 会有空格

This commit is contained in:
yanmao 2022-01-22 18:06:13 +08:00
parent 4626ad9e76
commit 80d3f2ca34
3 changed files with 9 additions and 4 deletions

View File

@ -1,4 +1,4 @@
import { $, removeUnit } from '@aomao/engine';
import { $, isMobile, removeUnit } from '@aomao/engine';
import type {
PluginEntry,
CardEntry,
@ -35,7 +35,7 @@ import Unorderedlist from '@aomao/plugin-unorderedlist';
import Indent from '@aomao/plugin-indent';
// import type { IndentOptions } from '@aomao/plugin-indent';
import Heading from '@aomao/plugin-heading';
// import type { HeadingOptions } from '@aomao/plugin-heading';
import type { HeadingOptions } from '@aomao/plugin-heading';
import Strikethrough from '@aomao/plugin-strikethrough';
// import type { StrikethroughOptions } from '@aomao/plugin-strikethrough';
import Sub from '@aomao/plugin-sub';
@ -389,7 +389,12 @@ export const toolbarOptions: ToolbarOptions = {
},
};
const headingOptions: HeadingOptions = {
showAnchor: isMobile ? false : true,
};
export const pluginConfig: Record<string, PluginOptions> = {
[Heading.pluginName]: headingOptions,
[ToolbarPlugin.pluginName]: toolbarOptions,
[Table.pluginName]: tableOptions,
[MarkRange.pluginName]: markRangeOptions,

View File

@ -107,7 +107,7 @@
@media @mobile {
padding: 0;
height: auto;
overflow: hidden;
overflow: inherit;
}
}

View File

@ -45,7 +45,7 @@ class Block implements BlockModelInterface {
.getHandleListener('backspace', 'keydown')
?.on((event) => backspace.trigger(event));
event.on('keydown:space', (event) => this.triggerMarkdown(event));
event.on('keyup:space', (event) => this.triggerMarkdown(event));
}
}