Merge pull request #6333 from vinothkannans/rich-text-pasting

FIX: Use tight list format for GDocs html to markdown
This commit is contained in:
Vinoth Kannan
2018-08-30 12:14:50 +05:30
committed by GitHub
2 changed files with 27 additions and 2 deletions
@@ -109,6 +109,12 @@ export class Tag {
}
decorate(text) {
const parent = this.element.parent;
if (this.name === "p" && parent && parent.name === "li") { // fix for google docs
this.gap = "";
}
return `${this.gap}${this.prefix}${text}${this.suffix}${this.gap}`;
}
};
@@ -400,6 +406,12 @@ export class Tag {
return class extends Tag.block(name) {
decorate(text) {
let smallGap = "";
const parent = this.element.parent;
if (parent && parent.name === "ul") {
this.gap = "";
this.suffix = "\n";
}
if (this.element.filterParentNames(["li"]).length) {
this.gap = "";