From 53cb05998bd3ae6f091a433830e0093176b97ffc Mon Sep 17 00:00:00 2001 From: Vincent Chan <okcdz@diverse.space> Date: Fri, 12 Aug 2022 16:37:43 +0800 Subject: [PATCH] feat(doc): HTML converter --- .../lib/src/infra/html_converter.dart | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) 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) {