mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2024-08-30 18:12:39 +00:00
Merge pull request #1373 from LucasXu0/fix_checkbox_copy
fix: copy link and code style
This commit is contained in:
commit
ea46272b49
@ -241,6 +241,8 @@ class HTMLToNodesConverter {
|
|||||||
} else if (element.localName == HTMLTag.del) {
|
} else if (element.localName == HTMLTag.del) {
|
||||||
delta.insert(element.text,
|
delta.insert(element.text,
|
||||||
attributes: {BuiltInAttributeKey.strikethrough: true});
|
attributes: {BuiltInAttributeKey.strikethrough: true});
|
||||||
|
} else if (element.localName == HTMLTag.code) {
|
||||||
|
delta.insert(element.text, attributes: {BuiltInAttributeKey.code: true});
|
||||||
} else {
|
} else {
|
||||||
delta.insert(element.text);
|
delta.insert(element.text);
|
||||||
}
|
}
|
||||||
@ -276,11 +278,13 @@ class HTMLToNodesConverter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
final textNode = TextNode(delta: delta, attributes: attributes);
|
final textNode = TextNode(delta: delta, attributes: {
|
||||||
if (isCheckbox) {
|
if (attributes != null) ...attributes,
|
||||||
textNode.attributes["subtype"] = BuiltInAttributeKey.checkbox;
|
if (isCheckbox) ...{
|
||||||
textNode.attributes["checkbox"] = checked;
|
BuiltInAttributeKey.subtype: BuiltInAttributeKey.checkbox,
|
||||||
}
|
BuiltInAttributeKey.checkbox: checked,
|
||||||
|
}
|
||||||
|
});
|
||||||
return textNode;
|
return textNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -557,6 +561,17 @@ class NodesToHTMLConverter {
|
|||||||
final strong = html.Element.tag(HTMLTag.del);
|
final strong = html.Element.tag(HTMLTag.del);
|
||||||
strong.append(html.Text(op.text));
|
strong.append(html.Text(op.text));
|
||||||
childNodes.add(strong);
|
childNodes.add(strong);
|
||||||
|
} else if (attributes.length == 1 &&
|
||||||
|
attributes[BuiltInAttributeKey.code] == true) {
|
||||||
|
final code = html.Element.tag(HTMLTag.code);
|
||||||
|
code.append(html.Text(op.text));
|
||||||
|
childNodes.add(code);
|
||||||
|
} else if (attributes.length == 1 &&
|
||||||
|
attributes[BuiltInAttributeKey.href] != null) {
|
||||||
|
final anchor = html.Element.tag(HTMLTag.anchor);
|
||||||
|
anchor.attributes["href"] = attributes[BuiltInAttributeKey.href];
|
||||||
|
anchor.append(html.Text(op.text));
|
||||||
|
childNodes.add(anchor);
|
||||||
} else {
|
} else {
|
||||||
final span = html.Element.tag(HTMLTag.span);
|
final span = html.Element.tag(HTMLTag.span);
|
||||||
final cssString = _attributesToCssStyle(attributes);
|
final cssString = _attributesToCssStyle(attributes);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user