shipglot

markup-mismatch

Tags or Markdown structure differ from the source.

Default severity: error

What it checks

HTML and rich-text tags (<b>, <a href>, <link>…</link>) must survive translation with the same names, properly nested, and link targets (href, src) unchanged; title and alt text may be translated. A translation must not add other attributes: an added onclick or javascript: URL runs script. Markdown links must keep their URL, code spans their exact content, and bold markers, headings and list markers their structure. A lost or unbalanced tag breaks rendering or crashes rich-text formatters.

Example

A bold tag dropped from a rich-text message. Config used for both runs:

{
  "sourceLocale": "en",
  "files": [
    {
      "format": "next-intl-json",
      "path": "messages/{locale}.json"
    }
  ]
}

Fails

messages/en.json

{
  "plan": "Your <b>Pro</b> plan renews tomorrow."
}

messages/fr.json

{
  "plan": "Votre abonnement Pro sera renouvelé demain."
}

Gate output

  • plan
    markup mismatch: missing <b>, </b>
    messages/fr.json:2

Passes

messages/en.json

{
  "plan": "Your <b>Pro</b> plan renews tomorrow."
}

messages/fr.json

{
  "plan": "Votre abonnement <b>Pro</b> sera renouvelé demain."
}

Gate output

No markup-mismatch finding.

Change its severity

{
  "checks": {
    "markup-mismatch": "warning"
  }
}

Use "off" to disable it. To hide one finding, add "suppress": ["markup-mismatch:plan"]; a suppress rule that stops matching is reported so it can be removed.

All checks