From 0bb0998433e94a8cbabd8ed70f1857fd1e86dd34 Mon Sep 17 00:00:00 2001 From: vnniz Date: Thu, 21 Sep 2023 21:56:54 +0700 Subject: [PATCH] Update comments --- .../lib/src/document_to_markdown_serializer.dart | 10 ++++++---- .../lib/src/markdown_to_document_parsing.dart | 6 +++--- 2 files changed, 9 insertions(+), 7 deletions(-) diff --git a/super_editor_markdown/lib/src/document_to_markdown_serializer.dart b/super_editor_markdown/lib/src/document_to_markdown_serializer.dart index aa3bd198db..a40b953b9a 100644 --- a/super_editor_markdown/lib/src/document_to_markdown_serializer.dart +++ b/super_editor_markdown/lib/src/document_to_markdown_serializer.dart @@ -364,11 +364,13 @@ class AttributedTextMarkdownSerializer extends AttributionVisitor { } } -/// [DocumentNodeMarkdownSerializer] for serializing [ParagraphNode]s as headers. +/// [DocumentNodeMarkdownSerializer], which serializes Markdown headers to +/// [ParagraphNode]s with an appropriate header block type, and (optionally) a +/// block alignment. /// -/// We already had a header parser in [ParagraphNodeSerializer] but without the alignment, -/// so we added [HeaderNodeSerializer] to support the alignment for headers. Therefore, -/// the [HeaderNodeSerializer] **MUST** be put before the [ParagraphNodeSerializer]. +/// Headers are represented by `ParagraphNode`s and therefore this serializer must +/// run before a [ParagraphNodeSerializer], so that this serializer can process +/// header-specific details, such as header alignment. class HeaderNodeSerializer extends NodeTypedDocumentNodeMarkdownSerializer { const HeaderNodeSerializer(this.markdownSyntax); diff --git a/super_editor_markdown/lib/src/markdown_to_document_parsing.dart b/super_editor_markdown/lib/src/markdown_to_document_parsing.dart index 69956548eb..ad1c246a20 100644 --- a/super_editor_markdown/lib/src/markdown_to_document_parsing.dart +++ b/super_editor_markdown/lib/src/markdown_to_document_parsing.dart @@ -700,9 +700,9 @@ class _TaskSyntax extends md.BlockSyntax { /// Parses a header preceded by an alignment token. /// -/// We already had a header serializer in [_ParagraphWithAlignmentSyntax] but without the alignment, -/// so we added [_HeaderWithAlignmentSyntax] to support the alignment for headers. Therefore, -/// the [_HeaderWithAlignmentSyntax] **MUST** be put before the [_ParagraphWithAlignmentSyntax]. +/// Headers are represented by `_ParagraphWithAlignmentSyntax`s and therefore +/// this parser must run before a [_ParagraphWithAlignmentSyntax], so that this parser +/// can process header-specific details, such as header alignment. class _HeaderWithAlignmentSyntax extends md.BlockSyntax { /// This pattern matches the text alignment notation. ///