Skip to content

Fix tag space warning for some languages #64

@naokomc

Description

@naokomc

Some languages do not use a single-byte space as a word divider. There is no word divider in Japanese, Chinese, Thai, Lao, and Khmer.
https://en.wikipedia.org/wiki/Word_divider?oldformat=true#None

It would be great if the space warning around HTML tags can be modified to accommodate these languages.

Case 1: No spaces UNLESS the tag is next to a single-byte character or symbol (Lao, Japanese, and Khmer)

Correct spacing

Add a space only if tag is next to a single-byte character.

  • 日本語に接している<a href="#">タグ</a>です。
  • 英単語に接している <a href="#">tag</a> です。
  • 英単語に接している "<a href="#">tag</a>" です。
  • 英単語に接している <a href="#">"tag"</a> です。

Incorrect spacing

These are missing spaces around HTML tags.

  • 英単語に接している<a href="#">tag</a>です。
  • 英単語に接している<a href="#">"tag"</a>です。
  • 英単語に接している"<a href="#">tag</a>"です。
  • 不正な<code>function_name</code>。 (for this one, only 1 space is missing – before the opening tag. No space is needed after the closing tag since the character after it is a Japanese period)

Case 2: ALWAYS no spaces (Chinese)

Correct spacing

No spaces before or after tags.

-要发表评论,您必须先<a href="%s">登录</a>。 (See translation history)
-<strong>WordPress升级成功!</strong>请重新登录以查看更新详情。

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions