From 3aac2c813173237846418fd44c8c54ca7f935392 Mon Sep 17 00:00:00 2001 From: "Jules Sam. Randolph" Date: Wed, 24 Mar 2021 14:20:29 -0300 Subject: [PATCH] feat: support lower-greek list style type prefixes --- .../src/elements/usePrefixRenderer.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/packages/render-html/src/elements/usePrefixRenderer.tsx b/packages/render-html/src/elements/usePrefixRenderer.tsx index 1c65fadb3..cc0fa1557 100644 --- a/packages/render-html/src/elements/usePrefixRenderer.tsx +++ b/packages/render-html/src/elements/usePrefixRenderer.tsx @@ -115,6 +115,18 @@ const UpperAlphaPrefixRenderer = ({ ); }; +const LowerGreekPrefixRenderer = ({ + index, + ...props +}: ListPrefixRendererProps) => { + return ( + + ); +}; + const NoPrefixRenderer = () => null; const DecimalPrefixRenderer = ({ @@ -182,6 +194,11 @@ const upperAlpha: PrefixSpecs = { computeStrSize: (length) => numOfCharsInPrefix(length, 26) }; +const lowerGreek: PrefixSpecs = { + Component: LowerGreekPrefixRenderer, + computeStrSize: (length) => numOfCharsInPrefix(length, 24) +}; + const prefixRenderersMap: Record = ({ none, disc, @@ -192,6 +209,7 @@ const prefixRenderersMap: Record = ({ 'upper-alpha': upperAlpha, 'lower-latin': lowerAlpha, 'upper-latin': upperAlpha, + 'lower-greek': lowerGreek, 'decimal-leading-zero': decimalLeadingZero } as Partial>) as Record< SupportedListStyleType,