Skip to content

Conversation

@trtshen
Copy link
Collaborator

@trtshen trtshen commented Jan 9, 2026

This pull request addresses a whitespace handling bug in the detectLanguage pipe, which previously caused spaces between inline elements (like <a> tags) and adjacent text to be stripped in rendered HTML. The fix ensures that original whitespace is preserved and improves the reliability of language detection by increasing the minimum text length threshold.

Whitespace preservation and language detection improvements:

  • Changed the addLanguageAttributes() method in utils.service.ts to use the original node.textContent (with whitespace) for rendering, while still using the trimmed text for validation and language detection. This prevents spaces between inline elements and text from being lost.
  • Increased the minimum text length required for language detection from 10 to 20 characters, improving detection accuracy and reducing false positives on short phrases.

Documentation and context:

  • Added a detailed fix summary in docs/fixes/CORE-7942-whitespace-fix.md, including problem analysis, code examples, solution rationale, impact assessment, and testing recommendations.

@trtshen trtshen self-assigned this Jan 9, 2026
@trtshen trtshen requested a review from shawnm0705 January 9, 2026 06:19
@trtshen trtshen merged commit ff4cccb into prerelease Jan 13, 2026
@trtshen trtshen deleted the 2.4.y.z/CORE-7942/description-wysiwyg-fix branch January 13, 2026 01:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants