Skip to content

Bugs related to individual tag class names #2771

@XeroAlpha

Description

@XeroAlpha

#2724 introduces two bugs about class names.

Example

/**
 * @example warning
 * 
 */

Bugs

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

  1. 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 ?? ''}`}>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions