Skip to content

fix(meta-fetcher): normalize whitespace in page titles (#393) - #398

Open
bhushan4work wants to merge 1 commit into
codercops:devfrom
bhushan4work:393
Open

bhushan4work wants to merge 1 commit into
codercops:devfrom
bhushan4work:393

Conversation

@bhushan4work

Copy link
Copy Markdown
Collaborator

normalize extracted page titles by decoding html entities, collapsing consecutive ascii whitespace into a single space, and trimming both ends. this prevents titles with multiline indentation or internal tabs from being stored with irregular spacing. non-ascii whitespace and meta content values are left untouched.

closes #393

how i tested this

  • added a regression test in meta-fetcher.test.ts that fails before the fix and passes after.
  • ran npm run check (0 errors, 0 warnings).
  • ran npm run test (107 test files, 2054 tests passed).
  • ran npm run build (clean server and static asset build).
  • rebased onto latest origin/dev with zero merge conflicts and a clean working tree.
  • pushed to origin/393 and verified remote commit sha bc04400.

ai assistance

none

type of change

  • bug fix
  • new template
  • new feature
  • documentation
  • tests
  • refactoring
  • performance improvement
  • other (describe below)

screenshots

not applicable (no visual changes)

checklist

  • this pr targets dev
  • i was assigned the linked issue
  • npm run check passes
  • npm run test passes
  • for a bug fix: the new test fails without my change
  • tested locally with npm run dev
  • screenshots included for visual changes
  • new templates follow the template guidelines

This branch has not been deployed

No deployments
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.

Preview checker: a <title> written over several lines keeps its line break and indentation

1 participant