Skip to main content
The foundation node for both bullet and numbered lists with Word-compatible formatting. Handles numbering, indentation, styling, and keyboard navigation for professional list creation.

Key Features

Custom Node View

The list item uses a custom node view that provides:
  • Visual numbering/bullets - Rendered separately from content
  • Smart indentation - Calculates proper spacing based on Word styles
  • Font inheritance - Respects document and paragraph styles
  • Marker alignment - Handles left, right, and centered numbering

Word Compatibility Attributes

The list item maintains numerous Word-specific attributes:
  • numId - Links to Word numbering definition
  • level - Tracks nesting depth (0-8)
  • lvlText - Format string for numbering
  • listNumberingType - decimal, upperRoman, lowerAlpha, etc.
  • indent - Precise indentation values
  • spacing - Line and paragraph spacing

OOXML Structure

<w:p>
  <w:pPr>
    <w:numPr>
      <w:ilvl w:val="0"/>
      <w:numId w:val="1"/>
    </w:numPr>
  </w:pPr>
  <w:r>
    <w:t>List item content</w:t>
  </w:r>
</w:p>

Keyboard Shortcuts

ActionShortcutDescription
New ItemEnterCreates a new list item at the same level
Line BreakShift+EnterAdds a line break within the current item
IndentTabIncreases nesting level
OutdentShift+TabDecreases nesting level
Exit ListEnter twiceCreates a paragraph after the list

Numbering Formats

Standard Formats

  • Decimal - 1, 2, 3, 4…
  • Lower Alpha - a, b, c, d…
  • Upper Alpha - A, B, C, D…
  • Lower Roman - i, ii, iii, iv…
  • Upper Roman - I, II, III, IV…

Custom Formats

Word supports complex numbering like:
  • Legal - 1.1, 1.2, 1.2.1, 1.2.2…
  • Outline - I.A.1.a.i…
  • Custom - Chapter 1, Section A, Article i…

Use Case

  • Document Structure - Organize content hierarchically
  • Instructions - Step-by-step procedures
  • Outlines - Multi-level document planning
  • Legal Documents - Complex numbered sections
  • Word Import/Export - Perfect numbering preservation

Options

Configure the extension behavior:
htmlAttributes
Object
HTML attributes for list item elements
bulletListTypeName
string
default:"bulletList"
Name of bullet list node type
orderedListTypeName
string
default:"orderedList"
Name of ordered list node type

Attributes

Node attributes that can be set and retrieved:
markerType
string
Virtual attribute for marker display
lvlText
string
Level text template for numbering
listNumberingType
string
Numbering format type
listLevel
Array
List level hierarchy
lvlJc
string
Level justification (left, right, center)
listParagraphProperties
Object
Indentation and spacing info
listRunProperties
Object
Run properties for list item
numId
string
Numbering definition ID
numPrType
string
default:"inline"
Numbering properties type
level
string
Current nesting level
attributes
Object
Additional attributes
spacing
Object
Spacing configuration
indent
Object
Indentation settings
markerStyle
Object
Marker styling
styleId
string
Linked style ID
customFormat
string
Custom numbering format
importedFontFamily
string
Font family from import
importedFontSize
string
Font size from import

Commands

setLinkedStyle

Apply a linked style to the selected paragraphs
Works with custom selection preservation
Example:
const style = editor.helpers.linkedStyles.getStyleById('Heading1');
editor.commands.setLinkedStyle(style);
Parameters:
style
LinkedStyle
required
The style object to apply

toggleLinkedStyle

Toggle a linked style on the current selection
Removes style if already applied, applies it if not
Example:
const style = editor.helpers.linkedStyles.getStyleById('Heading1');
editor.commands.toggleLinkedStyle(style)
editor.commands.toggleLinkedStyle(style, 'paragraph')
Parameters:
style
LinkedStyle
required
The linked style to apply (with id property)
nodeType
string | any
required
Node type to restrict toggle to (e.g., ‘paragraph’)

setStyleById

Apply a linked style by its ID
Looks up the style from loaded Word styles
Example:
editor.commands.setStyleById('Heading1')
editor.commands.setStyleById('Normal')
Parameters:
styleId
string
required
The style ID to apply (e.g., ‘Heading1’)

restorePreservedSelection

Restore the preserved selection
Used internally to maintain selection when interacting with toolbar
Example:
// Restore selection after toolbar interaction
editor.commands.restorePreservedSelection()
Returns: Function Command function

Helpers

getStyles

Get all available linked styles Example:
const styles = editor.helpers.linkedStyles.getStyles();
// Returns all styles from the Word document
Returns:
return
Array
required
Array of linked style objects

getStyleById

Get a specific style by ID Example:
const headingStyle = editor.helpers.linkedStyles.getStyleById('Heading1');
Parameters:
styleId
string
required
The style ID to find
Returns:
return
Object
required
The style object or undefined

Keyboard Shortcuts

CommandShortcutDescription
splitListItem()EnterSplit list item at cursor
createParagraphNear()Shift-EnterCreate paragraph in list
increaseListIndent()TabIncrease list indentation
decreaseListIndent()Shift-TabDecrease list indentation

Types

IndentObject

LinkedStyle

Style definition from Word document

SelectionState

Selection state

Source Code

I