From 7458264e02c0b802cd73d8a4256a4226d1e7e35c Mon Sep 17 00:00:00 2001 From: bptato Date: Wed, 15 Dec 2021 15:45:48 +0100 Subject: Add roman list style type --- src/css/values.nim | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/css/values.nim') diff --git a/src/css/values.nim b/src/css/values.nim index 1dbe85a5..8a66b863 100644 --- a/src/css/values.nim +++ b/src/css/values.nim @@ -58,6 +58,7 @@ type CSSListStyleType* = enum LIST_STYLE_TYPE_NONE, LIST_STYLE_TYPE_DISC, LIST_STYLE_TYPE_CIRCLE, LIST_STYLE_TYPE_SQUARE, LIST_STYLE_TYPE_DECIMAL, + LIST_STYLE_TYPE_LOWER_ROMAN, LIST_STYLE_TYPE_UPPER_ROMAN, LIST_STYLE_TYPE_JAPANESE_INFORMAL type @@ -204,6 +205,8 @@ func listMarker*(t: CSSListStyleType, i: int): string = of LIST_STYLE_TYPE_CIRCLE: return "○ " of LIST_STYLE_TYPE_SQUARE: return "□ " of LIST_STYLE_TYPE_DECIMAL: return $i & ". " + of LIST_STYLE_TYPE_UPPER_ROMAN: return romanNumber(i) & ". " + of LIST_STYLE_TYPE_LOWER_ROMAN: return romanNumber_lower(i) & ". " of LIST_STYLE_TYPE_JAPANESE_INFORMAL: return japaneseNumber(i) & "、" func r(c: CSSColor): int = @@ -610,7 +613,8 @@ func cssListStyleType(d: CSSDeclaration): CSSListStyleType = of "circle": return LIST_STYLE_TYPE_CIRCLE of "square": return LIST_STYLE_TYPE_SQUARE of "decimal": return LIST_STYLE_TYPE_DECIMAL - of "roman": return LIST_STYLE_TYPE_DECIMAL + of "upper-roman": return LIST_STYLE_TYPE_UPPER_ROMAN + of "lower-roman": return LIST_STYLE_TYPE_LOWER_ROMAN of "japanese-informal": return LIST_STYLE_TYPE_JAPANESE_INFORMAL raise newException(CSSValueError, "Invalid list style") -- cgit 1.4.1-2-gfad0