Partial fix Italics and <em> in East-Asian languages.

ShikiSuen

Well-known member
Affected version
2.1.9
Italics are not expected to be shown in East-Asian written languages (Korean, Japanese, Chinese).
(Plus, computer fonts on Windows render italic East-Asian texts terrible.)

I temporarily wrote a patch, but I think it has some limitations.
Since I think this is a bug for XenForo to resolve in its default theme template, I posted it here.

P.S.: one "zh" selector is enough for all Chinese language tags, including the current standard (zh-cmn-Hans, etc.) and those deprecated standards (zh-CN, etc.).

CSS:
:lang(zh), :lang(ja), :lang(ko){
    i, cite, em, var, address, dfn {font-style: normal;}
    .message-body i {border-bottom: dashed 1px @xf-paletteColor3 !important;}
}

I wonder how "cite" behaves in which occasions in XenForo.
 
Last edited:
Thank you for reporting this issue, it has now been resolved. We are aiming to include any changes that have been made in a future XF release (2.2.0 RC2).

Change log:
Remove italics by default on em tags in CJK languages
There may be a delay before changes are rolled out to the XenForo Community.
 
To expand a little bit, we have made some base style changes that reduce our use of italics in a few places where it isn't really necessary/beneficial anyway.

In terms of this specific issue, we have removed the default italics from <em> tags if we detect a CJK language, though we haven't applied it more generally. We could consider adding it to other tags, but <em> tags are really the only one we use with browser-standard styling out of the box and even then, quite infrequently.

In terms of changing the styling of <i> (and our italics BB code), I don't believe this is correct as this is an explicit use of italics (compared to em tags which use italics for emphasis). It's certainly very possible that non-CJK characters could be posted and italics could legitimately be used there, for example.
 
To expand a little bit, we have made some base style changes that reduce our use of italics in a few places where it isn't really necessary/beneficial anyway.

In terms of this specific issue, we have removed the default italics from <em> tags if we detect a CJK language, though we haven't applied it more generally. We could consider adding it to other tags, but <em> tags are really the only one we use with browser-standard styling out of the box and even then, quite infrequently.

In terms of changing the styling of <i> (and our italics BB code), I don't believe this is correct as this is an explicit use of italics (compared to em tags which use italics for emphasis). It's certainly very possible that non-CJK characters could be posted and italics could legitimately be used there, for example.
I am thinking of another idea: The "italics" on computer was designed to express texts in a handwritten style.
XenForo in the future may allow users to define the default cursive fonts and have a checkbox to determine whether apply cursive fonts (or serif fonts or sans-serif... as long as it is different from the font catgory of the default article font) as default fonts tagged in <em> and <i>. Note that only macOS and iOS at this moment have default cursive font fallback setups. Linux can be customized to provide such support; Windows always falls behind.

If this is a bad idea, then dashed border bottm (as what I did in the main post) may work. Still, on your people's judgement call.
 
Top Bottom