Skip to content

Bring projects, wikis, and teams together with AI. AppFlowy is the AI collaborative workspace where you achieve more without losing control of your data. The leading open source Notion alternative.

feat(doc): HTML converter

Vincent Chan53cb05998bd3
diff --git a/frontend/app_flowy/packages/flowy_editor/lib/src/infra/html_converter.dart b/frontend/app_flowy/packages/flowy_editor/lib/src/infra/html_converter.dart
index cc7fd949ae..4a15b54859 100644
--- a/frontend/app_flowy/packages/flowy_editor/lib/src/infra/html_converter.dart
+++ b/frontend/app_flowy/packages/flowy_editor/lib/src/infra/html_converter.dart
@@ -484,6 +484,22 @@ class NodesToHTMLConverter {
});
}
+ /// Convert the rich text to HTML
+ ///
+ /// Use `<b>` for bold only.
+ /// Use `<i>` for italic only.
+ /// Use `<del>` for strikethrough only.
+ /// Use `<u>` for underline only.
+ ///
+ /// If the text has multiple styles, use a `<span>`
+ /// to mix the styles.
+ ///
+ /// A CSS style string is used to describe the styles.
+ /// The HTML will be:
+ ///
+ /// ```html
+ /// <span style="...">Text</span>
+ /// ```
html.Element _deltaToHtml(Delta delta,
{String? subType, int? end, bool? checked}) {
if (end != null) {