Sha256: f0dad6d347171c1ecccc4d5e6ca171a0ac6e16c15bc009c28ae43a8895828da0

Contents?: true

Size: 1.08 KB

Versions: 37

Compression:

Stored size: 1.08 KB

Contents

# 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.

:-1: Examples of **incorrect** code for this check:

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

:+1: Examples of **correct** code for this check:

```liquid
{% comment %}locales/en.default.json{% endcomment %}
{
  "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:

```yaml
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

- [Rule Source][codesource]
- [Documentation Source][docsource]

[codesource]: /lib/theme_check/checks/valid_html_translation.rb
[docsource]: /docs/checks/valid_html_translation.md

Version data entries

37 entries across 37 versions & 1 rubygems

Version Path
theme-check-1.10.3 docs/checks/valid_html_translation.md
theme-check-1.10.2 docs/checks/valid_html_translation.md
theme-check-1.10.1 docs/checks/valid_html_translation.md
theme-check-1.10.0 docs/checks/valid_html_translation.md
theme-check-1.9.2 docs/checks/valid_html_translation.md
theme-check-1.9.1 docs/checks/valid_html_translation.md
theme-check-1.9.0 docs/checks/valid_html_translation.md
theme-check-1.8.0 docs/checks/valid_html_translation.md
theme-check-1.7.2 docs/checks/valid_html_translation.md
theme-check-1.7.1 docs/checks/valid_html_translation.md
theme-check-1.7.0 docs/checks/valid_html_translation.md
theme-check-1.6.2 docs/checks/valid_html_translation.md
theme-check-1.6.1 docs/checks/valid_html_translation.md
theme-check-1.6.0 docs/checks/valid_html_translation.md
theme-check-1.5.2 docs/checks/valid_html_translation.md
theme-check-1.5.1 docs/checks/valid_html_translation.md
theme-check-1.5.0 docs/checks/valid_html_translation.md
theme-check-1.4.0 docs/checks/valid_html_translation.md
theme-check-1.3.0 docs/checks/valid_html_translation.md
theme-check-1.2.0 docs/checks/valid_html_translation.md