瀏覽代碼

feat(doc): HTML converter

Vincent Chan 2 年之前
父節點
當前提交
53cb05998b
共有 1 個文件被更改,包括 16 次插入0 次删除
  1. 16 0
      frontend/app_flowy/packages/flowy_editor/lib/src/infra/html_converter.dart

+ 16 - 0
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) {