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,
<li>
Discussion posts and replies are publicly visible
Add </ol> to explicitly close the list before starting the next section
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.
<ol>
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.
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( "</ol>", "<ol type='1' start=", local!nextStartNumber, ">", section_content )