diff options
author | bptato <nincsnevem662@gmail.com> | 2021-12-15 15:45:48 +0100 |
---|---|---|
committer | bptato <nincsnevem662@gmail.com> | 2021-12-15 16:03:25 +0100 |
commit | 7458264e02c0b802cd73d8a4256a4226d1e7e35c (patch) | |
tree | 8d2352bf64e295b8d0af8fb2a4f81f964b976a4a /src/css/values.nim | |
parent | 46ed9f5a9640bee2bcd54eaa6cb4646f2446e768 (diff) | |
download | chawan-7458264e02c0b802cd73d8a4256a4226d1e7e35c.tar.gz |
Add roman list style type
Diffstat (limited to 'src/css/values.nim')
-rw-r--r-- | src/css/values.nim | 6 |
1 files changed, 5 insertions, 1 deletions
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") |