Skip to content

(Question) Change numbering style of nested ordered listsΒ #587

Open
@alex3236

Description

@alex3236

At #62, @brandondrew raised the issue of incorrect numbering.

#42 fixed the numbering, but it doesn't solve the other problem: sublists commonly have a different number style.

For example, a common numbered list shall look like this, which is more readable:

1.  sth
    a.  sth
        i.  sth
        ii. sth
            1. sth
        iii.sth
        iv. sth

while current presentation is:

1.  sth
    1.  sth
        1.  sth
        2.  sth
            1.  sth
        3.  sth
        4.  sth

common nested styles are:

1st 2nd 3rd 4th
1. a. i. 1.
1. 1) a) 1.
1. 1.1. 1.1.1. 1.1.1.1.

Further more, there are multiple variants of one number style, which is useful in different scenarios. For example, a. could also be a) or (a).

If possible, consider implementing this, or provide a way to customize this behavior easily. Maybe do something like this:

function listNumberProvider(numeric: number, layer: number) {
    if (layer % 3 === 2) {
        return `${toAlphabet(numeric)}.`; // a.
    } else if (layer % 3 === 0) {
        return `${toRomeNumber(numeric)}.`; // i.
    } else {
        return `${numeric}.` // 1.
    }
}

const editor: BlockNoteEditor = useBlockNote({
    listNumberProvider: listNumberProvider
});
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions