Fix text overflow issue in lot/lof entries with long titles

Same issue as #1359 but for lot/lof titles.

Duplicate of #1427 but for the `hotfix/1.7.1` branch.