You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In Japanese, which do not use word divider, meta-tags can truncate title, description, etc. at unexpected position and can make them too short.
Because Japanese is a language that do not use word divider, basically there is no space character in Japanese text.
But sometimes a proper noun from a foreign language is directly used in Japanese, and in this case there can be space character in the proper noun even in Japanese text.
Here is an example. The following Japanese text has a space only at the 10th character, which is in the middle of "Microsoft Copilot".
Microsoft Copilotは、あなたの言葉をパワフルなコンテンツに変える AI アシスタントです。あなたのニーズに合わせて、文章を生成、要約、編集、変換したり、コードや詩などの創造的なコンテンツを作成したりします。
meta-tags truncates at the space. Therefore, if a Japanese text has spaces only near the beginning, it will be truncated near the beginning.
For example, even if the setting is to truncate to 80 characters, the Japanese text mentioned above will be truncated at the 10th character and the result become “Microsoft”, which is much shorter than 80 characters.
Request
I think README.md should mention that meta-tags truncates at the space and the issue mentioned above can occur.
How truncation at a space character occurs in meta-tags
meta-tags internally calls the truncate helper method of Ruby on Rails, and it has a method that wraps this helper method.
The third argument of this wrapper method is natural_separator and this argument can be omitted.
Actually there exists a call of the method with omission. The default value under this omission is a space character, so the truncation occurs at the space.
The text was updated successfully, but these errors were encountered:
Yes, it works for me! Thank you for this enhancement!
Because there seems no explanation about truncate_on_natural_separator for users in the repository, I have made PR #286. If it helps, please merge it.
Thanks.
Problem
In Japanese, which do not use word divider, meta-tags can truncate title, description, etc. at unexpected position and can make them too short.
Because Japanese is a language that do not use word divider, basically there is no space character in Japanese text.
But sometimes a proper noun from a foreign language is directly used in Japanese, and in this case there can be space character in the proper noun even in Japanese text.
Here is an example. The following Japanese text has a space only at the 10th character, which is in the middle of "Microsoft Copilot".
meta-tags truncates at the space. Therefore, if a Japanese text has spaces only near the beginning, it will be truncated near the beginning.
For example, even if the setting is to truncate to 80 characters, the Japanese text mentioned above will be truncated at the 10th character and the result become “Microsoft”, which is much shorter than 80 characters.
Request
I think README.md should mention that meta-tags truncates at the space and the issue mentioned above can occur.
How truncation at a space character occurs in meta-tags
meta-tags internally calls the truncate helper method of Ruby on Rails, and it has a method that wraps this helper method.
The third argument of this wrapper method is
natural_separator
and this argument can be omitted.Actually there exists a call of the method with omission. The default value under this omission is a space character, so the truncation occurs at the space.
The text was updated successfully, but these errors were encountered: