Skip to main content
March 9, 2026
Question

Issue with Numbering in Preview Section of Dynamic Letter Generation

  • March 9, 2026
  • 3 replies
  • 0 views

The Dynamic Letter Generation module uses multiple styletexteditors where users can select which sections should appear in the generated letter.

There are no formatting issues in the final generated letter. However, in the preview section, there is a numbering issue where an extra number appears even though there are no additional <li> elements present.

Please find the screenshot of the code below,

3 replies

shubhama926776
March 9, 2026

Add </ol> to explicitly close the list before starting the next section

March 10, 2026



The reason I have not closed the <ol> tag is because the list continues later, starting from point 6. This is due to a requirement where the numbering needs to be dynamic based on the user’s selection.

I also checked whether there were any null values in the array that could be causing the extra “5.” to appear, but there are no null values present.

shubhama926776
March 10, 2026

styleTextEditor auto-inserts an empty <li> between sections in preview, causing the extra number.
Use start attribute on <ol> to close and reopen with correct numbering:

concat(
"",
"
    ", section_content )


Track local!nextStartNumber by counting <li> items from previously selected sections.