Skip to content

Commit 1ecbd4e

Browse files
committed
docs: Document the custom rule in a comment
1 parent c33bc59 commit 1ecbd4e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

package/src/components/Message/MessageSimple/utils/renderText.tsx

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -251,6 +251,13 @@ export const renderText = <
251251
top: 'top',
252252
};
253253

254+
/**
255+
* For lists and sublists, the default behavior of the markdown library we use is
256+
* to always renumber any list, so all ordered lists start from 1.
257+
*
258+
* This custom rule overrides this behavior both for top level lists and sublists,
259+
* in order to start the numbering from the number of the first list item provided.
260+
* */
254261
const customListAtLevel =
255262
(level: keyof typeof listLevels): ReactNodeOutput =>
256263
(node, output, { ...state }) => {

0 commit comments

Comments
 (0)