Skip to content
This repository has been archived by the owner on Jul 27, 2024. It is now read-only.

Latest commit

 

History

History
53 lines (36 loc) · 1.06 KB

valid_html_translation.md

File metadata and controls

53 lines (36 loc) · 1.06 KB

Prevent invalid HTML inside translations (ValidHTMLTranslation)

This check exists to prevent invalid HTML inside translations.

Check Details

This check is aimed at eliminating invalid HTML in translations.

👎 Examples of incorrect code for this check:

{
  "hello_html": "<h2>Hello, world</h1>",
  "image_html": "<a href='/spongebob'>Unclosed"
}

👍 Examples of correct code for this check:

{% # locales/en.default.json %}
{
  "hello_html": "<h1>Hello, world</h1>",
  "image_html": "<img src='spongebob.png'>",
  "line_break_html": "<br>",
  "self_closing_svg_html": "<svg />"
}

Check Options

The default configuration for this check is the following:

ValidHTMLTranslation:
  enabled: true

When Not To Use It

It is discouraged to to disable this rule.

Version

This check has been introduced in Theme Check 0.1.0.

Resources