Back to feed
Dev.to
Dev.to
7/23/2026
The one-line bug that broke Open Graph cards on 836 pages

The one-line bug that broke Open Graph cards on 836 pages

Short summary

A one-line slice(0, 60) bug silently truncated Open Graph card subtitles mid-word across 836 pages for a month. The fix seemed simple—break at the last space—but that breaks CJK languages with no word spaces. The author presents a robust clip() function using a space-position threshold to handle both Latin and CJK scripts, plus lessons on testing generated artifacts rather than build logs.

  • slice(0,60) cut OG card subtitles mid-word across 836 pages unnoticed for a month
  • Naive last-space fix breaks CJK languages that lack word delimiters
  • Robust clip() function uses space-position threshold to handle both Latin and CJK truncation

Generated with AI, which can make mistakes.

Is this a good recommendation for you?

Comments

Failed to load comments. Please try again.

Explore more