-
-
Notifications
You must be signed in to change notification settings - Fork 745
Closed
Milestone
Description
#2724 introduces two bugs about class names.
Example
/**
* @example warning
*
*/
Bugs
- spaces in name variable
The example renders as:
<div class="tsd-tag-Example: warning">
</div>
This results in the element having two classes: tsd-tag-Example:
and warning
, which makes this element looks weird.
- i18n string
When lang
is set to a different language, such as "zh-CN", the example renders as:
<div class="tsd-tag-示例: warning">
</div>
Using i18n strings within class names is not advisable, as it can lead to inconsistencies and confusion.
Solution
- <div class={`tsd-tag-${name}`}>
+ <div class={`tsd-tag-${item.tag} tsd-tag-${item.tag}-${item.name ?? ''}`}>