Skip to content

Commit c7d51f7

Browse files
JeanMechejosephperrott
authored andcommitted
refactor(api-gen): set deprecation message as inner html (#1978)
PR Close #1978
1 parent 323e1ef commit c7d51f7

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

bazel/api-gen/rendering/templates/deprecated-label.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,15 @@ export function DeprecatedLabel(props: {
1414
}) {
1515
const entry = props.entry;
1616

17-
if ('isDeprecated' in entry && !('deprecationMessage' in entry)) {
18-
return <span className={`${PARAM_KEYWORD_CLASS_NAME} docs-deprecated`}>@deprecated</span>;
19-
} else if ('deprecationMessage' in entry && entry.deprecationMessage !== null) {
17+
if ('deprecationMessage' in entry && entry.deprecationMessage !== null) {
2018
return (
2119
<div className={'docs-deprecation-message'}>
2220
<span className={`${PARAM_KEYWORD_CLASS_NAME} docs-deprecated`}>@deprecated</span>
23-
<span>{entry.deprecationMessage}</span>
21+
<span dangerouslySetInnerHTML={{__html: entry.deprecationMessage}}></span>
2422
</div>
2523
);
24+
} else if ('isDeprecated' in entry) {
25+
return <span className={`${PARAM_KEYWORD_CLASS_NAME} docs-deprecated`}>@deprecated</span>;
2626
}
2727

2828
return <></>;

0 commit comments

Comments
 (0)