Skip to content

chore(translate): consolidate data-URL placeholder regex into single constant #176

@luandro

Description

@luandro

Background

scripts/notion-translate/translateFrontMatter.ts defines its own inline regex for detecting data-URL placeholder paths:

```ts
// line ~50
//images/data_url_placeholder\d+_.png/
```

A DATA_URL_PLACEHOLDER_REGEX constant already exists elsewhere in the codebase. These two definitions can drift apart silently.

What to do

  • Import and reuse the existing DATA_URL_PLACEHOLDER_REGEX constant in translateFrontMatter.ts (or move the canonical definition to constants.ts if it isn't there already)
  • Remove the inline duplicate regex
  • Add a test or comment that makes the single-source-of-truth relationship explicit

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions