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 { import type {
PluginEntry, PluginEntry,
CardEntry, CardEntry,
@ -35,7 +35,7 @@ import Unorderedlist from '@aomao/plugin-unorderedlist';
import Indent from '@aomao/plugin-indent'; import Indent from '@aomao/plugin-indent';
// import type { IndentOptions } from '@aomao/plugin-indent'; // import type { IndentOptions } from '@aomao/plugin-indent';
import Heading from '@aomao/plugin-heading'; 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 Strikethrough from '@aomao/plugin-strikethrough';
// import type { StrikethroughOptions } from '@aomao/plugin-strikethrough'; // import type { StrikethroughOptions } from '@aomao/plugin-strikethrough';
import Sub from '@aomao/plugin-sub'; 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> = { export const pluginConfig: Record<string, PluginOptions> = {
[Heading.pluginName]: headingOptions,
[ToolbarPlugin.pluginName]: toolbarOptions, [ToolbarPlugin.pluginName]: toolbarOptions,
[Table.pluginName]: tableOptions, [Table.pluginName]: tableOptions,
[MarkRange.pluginName]: markRangeOptions, [MarkRange.pluginName]: markRangeOptions,

View File

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

View File

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