From e5044d9e34ffdc55bff38265842e5860aa2a0932 Mon Sep 17 00:00:00 2001 From: singerdmx Date: Tue, 15 Dec 2020 21:38:55 -0800 Subject: [PATCH] Add ListAttribute --- lib/models/documents/attribute.dart | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/lib/models/documents/attribute.dart b/lib/models/documents/attribute.dart index 412d7a9c..cb580103 100644 --- a/lib/models/documents/attribute.dart +++ b/lib/models/documents/attribute.dart @@ -7,7 +7,7 @@ enum AttributeScope { class Attribute { final String key; final AttributeScope scope; - T value; + final T value; Attribute(this.key, this.scope, this.value); } @@ -44,3 +44,21 @@ class HeaderAttribute extends Attribute { // H3 in HTML Attribute get level3 => Attribute(key, scope, 3); } + +class ListAttribute extends Attribute { + ListAttribute(String val) : super('list', AttributeScope.BLOCK, val); + + // "attributes":{"list":"ordered"} + Attribute get ordered => Attribute(key, scope, 'ordered'); + + // "attributes":{"list":"bullet"} + Attribute get bullet => Attribute(key, scope, 'bullet'); +} + +class CodeBlockAttribute extends Attribute { + CodeBlockAttribute() : super('code-block', AttributeScope.BLOCK, null); +} + +class BlockQuoteAttribute extends Attribute { + BlockQuoteAttribute() : super('blockquote', AttributeScope.BLOCK, null); +}