Skip to content

Commit

Permalink
引用格式可包括多个段落
Browse files Browse the repository at this point in the history
  • Loading branch information
fgt1t5y committed Sep 27, 2024
1 parent 33ebad2 commit a52c8a0
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/components/editor/schema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ export const schema = new Schema({
},
},
blockquote: {
content: "inline*",
content: "paragraph+",
group: "block",
defining: true,
parseDOM: [{ tag: "blockquote" }],
Expand Down
2 changes: 1 addition & 1 deletion src/components/editor/toolbar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ class ToolbarView {
}

const activeNode = getActiveNodeName(view);
if (activeNode) {
if (activeNode && activeNode in this.buttons.lineFormat) {
setActive(this.buttons.lineFormat[activeNode], true);
this.lastActiveLineFormat = activeNode;
}
Expand Down
4 changes: 2 additions & 2 deletions src/components/editor/tools.ts
Original file line number Diff line number Diff line change
Expand Up @@ -121,11 +121,11 @@ export const toolsRaw = [
type: "lineFormat",
},
{
command: setBlockType(schema.nodes.blockquote),
command: wrapIn(schema.nodes.blockquote),
name: "blockquote",
key: "Mod-q",
icon: "i-quote",
type: "lineFormat",
type: "node",
},
{ command: insertImage(), name: "image", icon: "i-image", type: "node" },
{
Expand Down
3 changes: 1 addition & 2 deletions src/styles/Default.css
Original file line number Diff line number Diff line change
Expand Up @@ -424,10 +424,9 @@ code {

blockquote {
margin: 1rem 0px;
color: var(--p-text-muted-color);
border-left: 4px solid var(--p-primary-color);
background-color: var(--p-content-background);
padding: 8px 16px;
padding: 1px 16px;
}

figure {
Expand Down

0 comments on commit a52c8a0

Please sign in to comment.