diff --git a/sphinx_js/typedoc.py b/sphinx_js/typedoc.py index 0f03f364..3936dc9f 100644 --- a/sphinx_js/typedoc.py +++ b/sphinx_js/typedoc.py @@ -437,7 +437,9 @@ def short_name(self) -> str: def _top_level_properties(self) -> TopLevelPropertiesDict: deprecated: Sequence[ir.DescriptionItem] | bool - deprecated = self.comment.get_tag_one("deprecated") or False + deprecated = self.comment.get_tag_one("deprecated") + if not deprecated: + deprecated = "deprecated" in self.comment.tags return dict( name=self.short_name(), path=ir.Pathname(self.path), diff --git a/tests/test_build_ts/source/class.ts b/tests/test_build_ts/source/class.ts index efc70a47..c9c0ca06 100644 --- a/tests/test_build_ts/source/class.ts +++ b/tests/test_build_ts/source/class.ts @@ -77,7 +77,12 @@ export function selfReferential(b: typeof selfReferential) {} /** * @deprecated since v20! */ -export function deprecatedFunction() {} +export function deprecatedFunction1() {} + +/** + * @deprecated + */ +export function deprecatedFunction2() {} /** diff --git a/tests/test_build_ts/source/docs/deprecated.rst b/tests/test_build_ts/source/docs/deprecated.rst index 2814240d..cee9d261 100644 --- a/tests/test_build_ts/source/docs/deprecated.rst +++ b/tests/test_build_ts/source/docs/deprecated.rst @@ -1 +1,3 @@ -.. js:autofunction:: deprecatedFunction +.. js:autofunction:: deprecatedFunction1 + +.. js:autofunction:: deprecatedFunction2 diff --git a/tests/test_build_ts/test_build_ts.py b/tests/test_build_ts/test_build_ts.py index 82db4d25..74d7e7f4 100644 --- a/tests/test_build_ts/test_build_ts.py +++ b/tests/test_build_ts/test_build_ts.py @@ -111,11 +111,17 @@ def test_deprecated(self): "deprecated", dedent( """\ - deprecatedFunction() + deprecatedFunction1() Note: Deprecated: since v20! + + deprecatedFunction2() + + Note: + + Deprecated. """ ), )