Skip to Content
  • Website
Codsen
  • Home
  • Open Source
  • Articles
  • About

backOpen Source→string-remove-widows→Examples

Table of Contents

  • Quick Take
  • Encode the inserted non-breaking space for CSS
  • Ignore a custom pair of template markers
  • Keep a dash with its neighbouring words when hyphen handling is enabled
  • Ignore every built-in template syntax preset
  • Ignore Hexo template expressions while processing surrounding text
  • Ignore Hugo template expressions while processing surrounding text
  • Ignore Jinja tags while processing surrounding text
  • Ignore Liquid tags while processing surrounding text
  • Ignore Nunjucks tags while processing surrounding text
  • Encode the inserted non-breaking space for JavaScript
  • Apply widow prevention only after the minimum character count is reached
  • Apply widow prevention only after the minimum word count is reached
  • Inspect which transformations were applied
  • Map progress reports into a caller-owned percentage range
  • Insert a raw non-breaking space instead of an encoded entity
  • Remove an existing widow-prevention entity
  • Keep both halves of a UK postcode together
  • Widow word removal from text within HTML
↑ back to top

Quick Take

↑ back to top

Encode the inserted non-breaking space for CSS

↑ back to top

Ignore a custom pair of template markers

↑ back to top

Keep a dash with its neighbouring words when hyphen handling is enabled

↑ back to top

Ignore every built-in template syntax preset

↑ back to top

Ignore Hexo template expressions while processing surrounding text

↑ back to top

Ignore Hugo template expressions while processing surrounding text

↑ back to top

Ignore Jinja tags while processing surrounding text

↑ back to top

Ignore Liquid tags while processing surrounding text

↑ back to top

Ignore Nunjucks tags while processing surrounding text

↑ back to top

Encode the inserted non-breaking space for JavaScript

↑ back to top

Apply widow prevention only after the minimum character count is reached

↑ back to top

Apply widow prevention only after the minimum word count is reached

↑ back to top

Inspect which transformations were applied

↑ back to top

Map progress reports into a caller-owned percentage range

↑ back to top

Insert a raw non-breaking space instead of an encoded entity

↑ back to top

Remove an existing widow-prevention entity

↑ back to top

Keep both halves of a UK postcode together

↑ back to top

Widow word removal from text within HTML

↑ back to top
back 

Copyright

All rights reserved © Roy Revelt 2026
All our open source packages are under MIT licenceopens in a new tab

Activities

🐛 See a bug? Raise an issueopens in a new tab
💘 Check out the Indiewebopens in a new tab and Libera manifestoopens in a new tab