Procházet zdrojové kódy

Support blockquotes in Classic editor

Ref T727
pull/443/head
Matt Baer před 3 roky
rodič
revize
5a4ff2a9de
4 změnil soubory, kde provedl 6 přidání a 6 odebrání
  1. +2
    -1
      less/prose-editor.less
  2. +1
    -1
      prose/markdownParser.js
  3. +3
    -3
      prose/markdownSerializer.js
  4. +0
    -1
      prose/schema.js

+ 2
- 1
less/prose-editor.less Zobrazit soubor

@@ -293,7 +293,8 @@ li.ProseMirror-selectednode:after {


.ProseMirror blockquote { .ProseMirror blockquote {
padding-left: 1em; padding-left: 1em;
border-left: 3px solid #eee;
border-left: 4px solid #ddd;
color: #767676;
margin-left: 0; margin-left: 0;
margin-right: 0; margin-right: 0;
} }


+ 1
- 1
prose/markdownParser.js Zobrazit soubor

@@ -7,7 +7,7 @@ export const writeFreelyMarkdownParser = new MarkdownParser(
writeFreelySchema, writeFreelySchema,
markdownit("commonmark", { html: true }), markdownit("commonmark", { html: true }),
{ {
// blockquote: { block: "blockquote" },
blockquote: { block: "blockquote" },
paragraph: { block: "paragraph" }, paragraph: { block: "paragraph" },
list_item: { block: "list_item" }, list_item: { block: "list_item" },
bullet_list: { block: "bullet_list" }, bullet_list: { block: "bullet_list" },


+ 3
- 3
prose/markdownSerializer.js Zobrazit soubor

@@ -32,9 +32,9 @@ export const writeFreelyMarkdownSerializer = new MarkdownSerializer(
state.write("<!--more-->\n"); state.write("<!--more-->\n");
state.closeBlock(node); state.closeBlock(node);
}, },
// blockquote(state, node) {
// state.wrapBlock("> ", undefined, node, () => state.renderContent(node));
// },
blockquote(state, node) {
state.wrapBlock("> ", null, node, () => state.renderContent(node));
},
code_block(state, node) { code_block(state, node) {
state.write(`\`\`\`${node.attrs.params || ""}\n`); state.write(`\`\`\`${node.attrs.params || ""}\n`);
state.text(node.textContent, false); state.text(node.textContent, false);


+ 0
- 1
prose/schema.js Zobrazit soubor

@@ -3,7 +3,6 @@ import { Schema } from "prosemirror-model";


export const writeFreelySchema = new Schema({ export const writeFreelySchema = new Schema({
nodes: schema.spec.nodes nodes: schema.spec.nodes
.remove("blockquote")
.addToEnd("readmore", { .addToEnd("readmore", {
inline: false, inline: false,
content: "", content: "",


Načítá se…
Zrušit
Uložit