Fix SUMMARY_MAX_PARAGRAPHS with SUMMARY_MAX_LENGTH

When, for example, the content is 2 paragraphs, each consisting of 30
words, and SUMMARY_MAX_PARAGRAPHS=1 and SUMMARY_MAX_LENGTH=50, the
current behavior produces a summary with 50 words and 2 paragraphs,
effectively ignoring SUMMARY_MAX_PARAGRAPHS.

This change inverts this behavior: the resulting summary from the above
situation will consist of the entire first 30 word paragraph.

In the case where the first paragraph(s) is longer than
SUMMARY_MAX_LENGTH, the summary will still be truncated to that length.

This change brings the actual behavior in line with the documented
behavior.
This commit is contained in:
Scott Colby 2024-11-23 11:32:00 +01:00
commit 4c36dafaf6
3 changed files with 30 additions and 5 deletions

3
RELEASE.md Normal file
View file

@ -0,0 +1,3 @@
Release type: patch
Fix SUMMARY_MAX_PARAGRAPHS not being respected in some combinations with SUMMARY_MAX_LENGTH.