+ */`);
+
+ equal(
+ comment.summary,
+ [
+ { kind: "text", text: 'Base class method
\n" + "div.tsd-comment.tsd-typography": { + "p": "Base class method" + } }, { "div.tsd-parameters": [ @@ -433,9 +435,6 @@ } ] }, - { - "div.tsd-comment.tsd-typography": [] - }, { "aside.tsd-sources": { "ul": { diff --git a/src/test/renderer/specs/classes/GH3007.DOMBase.json b/src/test/renderer/specs/classes/GH3007.DOMBase.json new file mode 100644 index 000000000..18378c675 --- /dev/null +++ b/src/test/renderer/specs/classes/GH3007.DOMBase.json @@ -0,0 +1,505 @@ +{ + "div.container.container-main": [ + { + "div.col-content": [ + { + "div.tsd-page-title": [ + { + "tag": "ul.tsd-breadcrumb", + "props": { + "aria-label": "Breadcrumb" + }, + "children": [ + { + "li": { + "tag": "a", + "props": { + "href": "../modules/GH3007.json" + }, + "children": "GH3007" + } + }, + { + "li": { + "tag": "a", + "props": { + "href": "", + "aria-current": "page" + }, + "children": "DOMBase" + } + } + ] + }, + { + "h1": "Class DOMBaseGeneric class
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "section.tsd-panel.tsd-comment": { + "div.tsd-comment.tsd-typography": { + "p": "Generic class" } - ] + } }, { "section.tsd-panel": [ diff --git a/src/test/renderer/specs/classes/ModifiersClass.json b/src/test/renderer/specs/classes/ModifiersClass.json index d2b69f253..e4650c528 100644 --- a/src/test/renderer/specs/classes/ModifiersClass.json +++ b/src/test/renderer/specs/classes/ModifiersClass.json @@ -202,18 +202,52 @@ ] }, { - "div.tsd-description": { - "h4.tsd-returns-title": [ - "Returns ", - { - "tag": "a.tsd-signature-type.tsd-kind-class", - "props": { - "href": "" - }, - "children": "ModifiersClass" + "div.tsd-description": [ + { + "div.tsd-comment.tsd-typography": { + "p": [ + "#2934 same page link", + { + "tag": "a.tsd-kind-class", + "props": { + "href": "#" + }, + "children": { + "code": "ModifiersClass" + } + } + ] } - ] - } + }, + { + "h4.tsd-returns-title": [ + "Returns ", + { + "tag": "a.tsd-signature-type.tsd-kind-class", + "props": { + "href": "" + }, + "children": "ModifiersClass" + } + ] + }, + { + "aside.tsd-sources": { + "ul": { + "li": [ + "Defined in ", + { + "tag": "a", + "props": { + "href": "index.ts" + }, + "children": "index.ts:73" + } + ] + } + } + } + ] } ] } diff --git a/src/test/renderer/specs/classes/RenderClass.json b/src/test/renderer/specs/classes/RenderClass.json index e87d21064..47a7ca9ee 100644 --- a/src/test/renderer/specs/classes/RenderClass.json +++ b/src/test/renderer/specs/classes/RenderClass.json @@ -26,14 +26,11 @@ ] }, { - "section.tsd-panel.tsd-comment": [ - { - "div.tsd-comment.tsd-typography": "Renderer class
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "section.tsd-panel.tsd-comment": { + "div.tsd-comment.tsd-typography": { + "p": "Renderer class" } - ] + } }, { "tag": "section.tsd-panel.tsd-hierarchy", @@ -106,10 +103,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "Index signature
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "Index signature" + } } ] } @@ -356,7 +352,9 @@ { "div.tsd-description": [ { - "div.tsd-comment.tsd-typography": "Ctor comment
\n" + "div.tsd-comment.tsd-typography": { + "p": "Ctor comment" + } }, { "div.tsd-parameters": [ @@ -392,9 +390,6 @@ } ] }, - { - "div.tsd-comment.tsd-typography": [] - }, { "aside.tsd-sources": [ { @@ -493,10 +488,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "Property
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "Property" + } }, { "aside.tsd-sources": { @@ -956,7 +950,9 @@ { "div.tsd-description": [ { - "div.tsd-comment.tsd-typography": "Method comment
\n" + "div.tsd-comment.tsd-typography": { + "p": "Method comment" + } }, { "div.tsd-parameters": [ @@ -988,9 +984,6 @@ } ] }, - { - "div.tsd-comment.tsd-typography": [] - }, { "aside.tsd-sources": [ { @@ -1083,7 +1076,9 @@ { "div.tsd-description": [ { - "div.tsd-comment.tsd-typography": "Sig 1 comment
\n" + "div.tsd-comment.tsd-typography": { + "p": "Sig 1 comment" + } }, { "h4.tsd-returns-title": [ @@ -1093,9 +1088,6 @@ } ] }, - { - "div.tsd-comment.tsd-typography": [] - }, { "aside.tsd-sources": { "ul": { @@ -1158,7 +1150,9 @@ { "div.tsd-description": [ { - "div.tsd-comment.tsd-typography": "Sig 2 comment
\n" + "div.tsd-comment.tsd-typography": { + "p": "Sig 2 comment" + } }, { "div.tsd-parameters": [ @@ -1190,9 +1184,6 @@ } ] }, - { - "div.tsd-comment.tsd-typography": [] - }, { "aside.tsd-sources": { "ul": { diff --git a/src/test/renderer/specs/documents/doc.json b/src/test/renderer/specs/documents/doc.json index e0a58f254..decb74ce4 100644 --- a/src/test/renderer/specs/documents/doc.json +++ b/src/test/renderer/specs/documents/doc.json @@ -21,7 +21,49 @@ } }, { - "div.tsd-panel.tsd-typography": "Rendered document
\nLink to this doc: link
\ntest();\n\n\n\nThis is an alert
\nEnum comment Value1
\n" + "div.tsd-comment.tsd-typography": { + "p": [ + "Enum comment", + { + "tag": "a.tsd-kind-enum-member", + "props": { + "href": "#value1" + }, + "children": "Value1" + } + ] + } }, { "div.tsd-comment.tsd-typography": { @@ -45,7 +56,9 @@ } ] }, - "Block tag
\n" + { + "p": "Block tag" + } ] } } @@ -61,7 +74,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:77" + "children": "index.ts:80" } ] } @@ -165,10 +178,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "Value1 comment
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "Value1 comment" + } }, { "aside.tsd-sources": { @@ -180,7 +192,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:79" + "children": "index.ts:82" } ] } @@ -219,10 +231,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "Value2 comment
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "Value2 comment" + } }, { "aside.tsd-sources": { @@ -234,7 +245,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:81" + "children": "index.ts:84" } ] } diff --git a/src/test/renderer/specs/functions/box.json b/src/test/renderer/specs/functions/box.json index b597048fc..473fcb350 100644 --- a/src/test/renderer/specs/functions/box.json +++ b/src/test/renderer/specs/functions/box.json @@ -105,7 +105,9 @@ { "div.tsd-description": [ { - "div.tsd-comment.tsd-typography": "Signature comment\n#2921 !Promise
\n" + "div.tsd-comment.tsd-typography": { + "p": "Signature comment\n#2921 !Promise" + } }, { "section.tsd-panel": [ @@ -147,10 +149,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "Item comment
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "Item comment" + } } ] } @@ -184,9 +185,6 @@ } ] }, - { - "div.tsd-comment.tsd-typography": [] - }, { "aside.tsd-sources": { "ul": { @@ -197,7 +195,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:110" + "children": "index.ts:113" } ] } diff --git a/src/test/renderer/specs/index.json b/src/test/renderer/specs/index.json index 358074286..68faaaf24 100644 --- a/src/test/renderer/specs/index.json +++ b/src/test/renderer/specs/index.json @@ -16,13 +16,57 @@ ] }, { - "div.tsd-panel.tsd-typography": "Readme text
\n" + "div.tsd-panel.tsd-typography": [ + { + "h1#gh3023-test.tsd-anchor-link": [ + "gh3023 <test>", + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#gh3023-test", + "aria-label": "Permalink" + } + } + ] + }, + { + "p": [ + "Anchor for above heading should be", + { + "code": "gh3023-test" + } + ] + } + ] } ] }, { "div.col-sidebar": { - "div.page-menu": [] + "div.page-menu": { + "tag": "details.tsd-accordion.tsd-page-navigation", + "props": { + "open": true + }, + "children": [ + { + "summary.tsd-accordion-summary": { + "h3": "On This Page" + } + }, + { + "div.tsd-accordion-details": { + "tag": "a", + "props": { + "href": "#gh3023-test" + }, + "children": { + "span": "gh3023Interface method
\n" + "div.tsd-comment.tsd-typography": { + "p": "Interface method" + } }, { "div.tsd-parameters": [ @@ -357,9 +359,6 @@ } ] }, - { - "div.tsd-comment.tsd-typography": [] - }, { "aside.tsd-sources": { "ul": { diff --git a/src/test/renderer/specs/interfaces/DisabledGroups.json b/src/test/renderer/specs/interfaces/DisabledGroups.json index 187a56a4e..4d7363857 100644 --- a/src/test/renderer/specs/interfaces/DisabledGroups.json +++ b/src/test/renderer/specs/interfaces/DisabledGroups.json @@ -41,7 +41,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -62,7 +62,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-call-signature", "props": { @@ -101,7 +101,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:129" + "children": "index.ts:132" } ] } @@ -194,7 +194,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:130" + "children": "index.ts:133" } ] } @@ -247,6 +247,17 @@ }, { "div.tsd-description": [ + { + "div.tsd-comment.tsd-typography": { + "p": { + "tag": "a", + "props": { + "href": "../" + }, + "children": "link to readme #3006" + } + } + }, { "h4.tsd-returns-title": [ "Returns ", @@ -265,7 +276,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:131" + "children": "index.ts:135" } ] } diff --git a/src/test/renderer/specs/interfaces/ExpandType.ExpandedByDefault.json b/src/test/renderer/specs/interfaces/ExpandType.ExpandedByDefault.json index 4df2574ad..dd0a91628 100644 --- a/src/test/renderer/specs/interfaces/ExpandType.ExpandedByDefault.json +++ b/src/test/renderer/specs/interfaces/ExpandType.ExpandedByDefault.json @@ -52,7 +52,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -181,10 +181,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "B
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "B" + } }, { "aside.tsd-sources": { diff --git a/src/test/renderer/specs/interfaces/GH2982.TMXDataNode.json b/src/test/renderer/specs/interfaces/GH2982.TMXDataNode.json new file mode 100644 index 000000000..4a14d5c79 --- /dev/null +++ b/src/test/renderer/specs/interfaces/GH2982.TMXDataNode.json @@ -0,0 +1,352 @@ +{ + "div.container.container-main": [ + { + "div.col-content": [ + { + "div.tsd-page-title": [ + { + "tag": "ul.tsd-breadcrumb", + "props": { + "aria-label": "Breadcrumb" + }, + "children": [ + { + "li": { + "tag": "a", + "props": { + "href": "../modules/GH2982.json" + }, + "children": "GH2982" + } + }, + { + "li": { + "tag": "a", + "props": { + "href": "", + "aria-current": "page" + }, + "children": "TMXDataNode" + } + } + ] + }, + { + "h1": "Interface TMXDataNode" + } + ] + }, + { + "div.tsd-signature": [ + { + "span.tsd-signature-keyword": "interface" + }, + " ", + { + "span.tsd-kind-interface": "TMXDataNode" + }, + " ", + { + "span.tsd-signature-symbol": "{" + }, + { + "br": [] + }, + " ", + { + "tag": "a.tsd-kind-property", + "props": { + "href": "#base" + }, + "children": "base" + }, + { + "span.tsd-signature-symbol": ":" + }, + " ", + { + "span.tsd-signature-symbol": "{" + }, + " ", + { + "span.tsd-kind-property": "extra" + }, + { + "span.tsd-signature-symbol": ":" + }, + " ", + { + "span.tsd-signature-type": "any" + }, + " ", + { + "span.tsd-signature-symbol": "}" + }, + { + "span.tsd-signature-symbol": ";" + }, + { + "br": [] + }, + { + "span.tsd-signature-symbol": "}" + } + ] + }, + { + "tag": "section.tsd-panel.tsd-hierarchy", + "props": { + "data-refl": "123" + }, + "children": [ + { + "h4": [ + "Hierarchy (", + { + "tag": "a", + "props": { + "href": "../hierarchy.html#GH2982.TMXDataNode" + }, + "children": "View Summary" + }, + ")" + ] + }, + { + "ul.tsd-hierarchy": { + "li.tsd-hierarchy-item": [ + { + "tag": "a.tsd-signature-type.tsd-kind-type-alias", + "props": { + "href": "../types/GH2982.TMXNode.json" + }, + "children": "TMXNode" + }, + { + "span.tsd-signature-symbol": "<" + }, + { + "span.tsd-signature-symbol": "{" + }, + " ", + { + "span.tsd-kind-property": "extra" + }, + { + "span.tsd-signature-symbol": ":" + }, + " ", + { + "span.tsd-signature-type": "any" + }, + " ", + { + "span.tsd-signature-symbol": "}" + }, + { + "span.tsd-signature-symbol": ">" + }, + { + "ul.tsd-hierarchy": { + "li.tsd-hierarchy-item": { + "span.tsd-hierarchy-target": "TMXDataNode" + } + } + } + ] + } + } + ] + }, + { + "aside.tsd-sources": { + "ul": { + "li": [ + "Defined in ", + { + "tag": "a", + "props": { + "href": "gh2982.ts" + }, + "children": "gh2982.ts:5" + } + ] + } + } + }, + { + "section.tsd-panel-group.tsd-index-group": { + "section.tsd-panel.tsd-index-panel": { + "tag": "details.tsd-index-content.tsd-accordion", + "props": { + "open": true + }, + "children": [ + { + "summary.tsd-accordion-summary.tsd-index-summary": { + "h5.tsd-index-heading.uppercase": "Index" + } + }, + { + "div.tsd-accordion-details": { + "section.tsd-index-section": [ + { + "h3.tsd-index-heading": "Properties" + }, + { + "div.tsd-index-list": [ + { + "tag": "a.tsd-index-link.tsd-is-inherited", + "props": { + "href": "#base" + }, + "children": { + "span": "base" + } + }, + "\n" + ] + } + ] + } + } + ] + } + } + }, + { + "tag": "details.tsd-panel-group.tsd-member-group.tsd-accordion", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-Properties" + }, + "children": { + "h2": "Properties" + } + }, + { + "section": { + "section.tsd-panel.tsd-member.tsd-is-inherited": [ + { + "h3.tsd-anchor-link#base": [ + { + "span": "base" + }, + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#base", + "aria-label": "Permalink" + } + } + ] + }, + { + "div.tsd-signature": [ + { + "span.tsd-kind-property": "base" + }, + { + "span.tsd-signature-symbol": ":" + }, + " ", + { + "span.tsd-signature-symbol": "{" + }, + " ", + { + "span.tsd-kind-property": "extra" + }, + { + "span.tsd-signature-symbol": ":" + }, + " ", + { + "span.tsd-signature-type": "any" + }, + " ", + { + "span.tsd-signature-symbol": "}" + } + ] + }, + { + "aside.tsd-sources": [ + { + "p": "Inherited from TMXNode.base" + }, + { + "ul": { + "li": [ + "Defined in ", + { + "tag": "a", + "props": { + "href": "gh2982.ts" + }, + "children": "gh2982.ts:2" + } + ] + } + } + ] + } + ] + } + } + ] + } + ] + }, + { + "div.col-sidebar": { + "div.page-menu": { + "tag": "details.tsd-accordion.tsd-page-navigation", + "props": { + "open": true + }, + "children": [ + { + "summary.tsd-accordion-summary": { + "h3": "On This Page" + } + }, + { + "div.tsd-accordion-details": { + "tag": "details.tsd-accordion.tsd-page-navigation-section", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-Properties" + }, + "children": "Properties" + }, + { + "div": { + "tag": "a.tsd-is-inherited", + "props": { + "href": "#base" + }, + "children": { + "span": "base" + } + } + } + ] + } + } + ] + } + } + } + ] +} diff --git a/src/test/renderer/specs/interfaces/GH3007.DOMIterable.json b/src/test/renderer/specs/interfaces/GH3007.DOMIterable.json new file mode 100644 index 000000000..e907f6478 --- /dev/null +++ b/src/test/renderer/specs/interfaces/GH3007.DOMIterable.json @@ -0,0 +1,343 @@ +{ + "div.container.container-main": [ + { + "div.col-content": [ + { + "div.tsd-page-title": [ + { + "tag": "ul.tsd-breadcrumb", + "props": { + "aria-label": "Breadcrumb" + }, + "children": [ + { + "li": { + "tag": "a", + "props": { + "href": "../modules/GH3007.json" + }, + "children": "GH3007" + } + }, + { + "li": { + "tag": "a", + "props": { + "href": "", + "aria-current": "page" + }, + "children": "DOMIterable" + } + } + ] + }, + { + "h1": "Interface DOMIterable" + } + ] + }, + { + "div.tsd-signature": [ + { + "span.tsd-signature-keyword": "interface" + }, + " ", + { + "span.tsd-kind-interface": "DOMIterable" + }, + " ", + { + "span.tsd-signature-symbol": "{" + }, + { + "br": [] + }, + " ", + { + "tag": "a.tsd-kind-property", + "props": { + "href": "#iterator" + }, + "children": "\"[iterator]\"" + }, + { + "span.tsd-signature-symbol": "?:" + }, + " ", + { + "span.tsd-signature-symbol": "()" + }, + " ", + { + "span.tsd-signature-symbol": "=>" + }, + " ", + { + "span.tsd-signature-type": "Iterator" + }, + { + "span.tsd-signature-symbol": "<" + }, + { + "span.tsd-signature-type": "Node" + }, + { + "span.tsd-signature-symbol": ">" + }, + { + "span.tsd-signature-symbol": ";" + }, + { + "br": [] + }, + { + "span.tsd-signature-symbol": "}" + } + ] + }, + { + "tag": "section.tsd-panel.tsd-hierarchy", + "props": { + "data-refl": "142" + }, + "children": [ + { + "h4": "Hierarchy" + }, + { + "ul.tsd-hierarchy": { + "li.tsd-hierarchy-item": [ + { + "span.tsd-signature-type": "Partial" + }, + { + "span.tsd-signature-symbol": "<" + }, + { + "tag": "a.tsd-signature-type.tsd-kind-class", + "props": { + "href": "../classes/GH3007.DOMBase.json" + }, + "children": "DOMBase" + }, + { + "span.tsd-signature-symbol": "<" + }, + { + "span.tsd-signature-type": "Node" + }, + { + "span.tsd-signature-symbol": ">" + }, + { + "span.tsd-signature-symbol": ">" + }, + { + "ul.tsd-hierarchy": { + "li.tsd-hierarchy-item": { + "span.tsd-hierarchy-target": "DOMIterable" + } + } + } + ] + } + } + ] + }, + { + "aside.tsd-sources": { + "ul": { + "li": [ + "Defined in ", + { + "tag": "a", + "props": { + "href": "gh3007.ts" + }, + "children": "gh3007.ts:9" + } + ] + } + } + }, + { + "section.tsd-panel-group.tsd-index-group": { + "section.tsd-panel.tsd-index-panel": { + "tag": "details.tsd-index-content.tsd-accordion", + "props": { + "open": true + }, + "children": [ + { + "summary.tsd-accordion-summary.tsd-index-summary": { + "h5.tsd-index-heading.uppercase": "Index" + } + }, + { + "div.tsd-accordion-details": { + "section.tsd-index-section": [ + { + "h3.tsd-index-heading": "Properties" + }, + { + "div.tsd-index-list": [ + { + "tag": "a.tsd-index-link.tsd-is-inherited", + "props": { + "href": "#iterator" + }, + "children": { + "span": "[iterator]?" + } + }, + "\n" + ] + } + ] + } + } + ] + } + } + }, + { + "tag": "details.tsd-panel-group.tsd-member-group.tsd-accordion", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-Properties" + }, + "children": { + "h2": "Properties" + } + }, + { + "section": { + "section.tsd-panel.tsd-member.tsd-is-inherited": [ + { + "h3.tsd-anchor-link#iterator": [ + { + "code.tsd-tag": "Optional" + }, + { + "span": "[iterator]" + }, + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#iterator", + "aria-label": "Permalink" + } + } + ] + }, + { + "div.tsd-signature": [ + { + "span.tsd-kind-property": "\"[iterator]\"" + }, + { + "span.tsd-signature-symbol": "?:" + }, + " ", + { + "span.tsd-signature-symbol": "()" + }, + " ", + { + "span.tsd-signature-symbol": "=>" + }, + " ", + { + "span.tsd-signature-type": "Iterator" + }, + { + "span.tsd-signature-symbol": "<" + }, + { + "span.tsd-signature-type": "Node" + }, + { + "span.tsd-signature-symbol": ">" + } + ] + }, + { + "aside.tsd-sources": [ + { + "p": "Inherited from Partial.[iterator]" + }, + { + "ul": { + "li": [ + "Defined in ", + { + "tag": "a", + "props": { + "href": "gh3007.ts" + }, + "children": "gh3007.ts:6" + } + ] + } + } + ] + } + ] + } + } + ] + } + ] + }, + { + "div.col-sidebar": { + "div.page-menu": { + "tag": "details.tsd-accordion.tsd-page-navigation", + "props": { + "open": true + }, + "children": [ + { + "summary.tsd-accordion-summary": { + "h3": "On This Page" + } + }, + { + "div.tsd-accordion-details": { + "tag": "details.tsd-accordion.tsd-page-navigation-section", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-Properties" + }, + "children": "Properties" + }, + { + "div": { + "tag": "a.tsd-is-inherited", + "props": { + "href": "#iterator" + }, + "children": { + "span": "[iterator]" + } + } + } + ] + } + } + ] + } + } + } + ] +} diff --git a/src/test/renderer/specs/interfaces/NoneCategory.json b/src/test/renderer/specs/interfaces/NoneCategory.json index fbc092f71..8f9f12a08 100644 --- a/src/test/renderer/specs/interfaces/NoneCategory.json +++ b/src/test/renderer/specs/interfaces/NoneCategory.json @@ -41,7 +41,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -62,7 +62,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -83,7 +83,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -119,7 +119,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:114" + "children": "index.ts:117" } ] } @@ -235,9 +235,6 @@ } ] }, - { - "div.tsd-comment.tsd-typography": [] - }, { "aside.tsd-sources": { "ul": { @@ -248,7 +245,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:119" + "children": "index.ts:122" } ] } @@ -303,9 +300,6 @@ } ] }, - { - "div.tsd-comment.tsd-typography": [] - }, { "aside.tsd-sources": { "ul": { @@ -316,7 +310,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:116" + "children": "index.ts:119" } ] } @@ -383,7 +377,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:117" + "children": "index.ts:120" } ] } diff --git a/src/test/renderer/specs/interfaces/NoneGroup.json b/src/test/renderer/specs/interfaces/NoneGroup.json index e83fc182e..925274d34 100644 --- a/src/test/renderer/specs/interfaces/NoneGroup.json +++ b/src/test/renderer/specs/interfaces/NoneGroup.json @@ -41,7 +41,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -62,7 +62,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -98,7 +98,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:122" + "children": "index.ts:125" } ] } @@ -193,9 +193,6 @@ } ] }, - { - "div.tsd-comment.tsd-typography": [] - }, { "aside.tsd-sources": { "ul": { @@ -206,7 +203,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:124" + "children": "index.ts:127" } ] } @@ -271,7 +268,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:125" + "children": "index.ts:128" } ] } diff --git a/src/test/renderer/specs/interfaces/gh2995.json b/src/test/renderer/specs/interfaces/gh2995.json new file mode 100644 index 000000000..c4182b433 --- /dev/null +++ b/src/test/renderer/specs/interfaces/gh2995.json @@ -0,0 +1,399 @@ +{ + "div.container.container-main": [ + { + "div.col-content": [ + { + "div.tsd-page-title": [ + { + "tag": "ul.tsd-breadcrumb", + "props": { + "aria-label": "Breadcrumb" + }, + "children": { + "li": { + "tag": "a", + "props": { + "href": "", + "aria-current": "page" + }, + "children": "gh2995" + } + } + }, + { + "h1": "Interface gh2995" + } + ] + }, + { + "div.tsd-signature": [ + { + "span.tsd-signature-keyword": "interface" + }, + " ", + { + "span.tsd-kind-interface": "gh2995" + }, + " ", + { + "span.tsd-signature-symbol": "{" + }, + { + "br": [] + }, + " ", + { + "tag": "a.tsd-kind-call-signature", + "props": { + "href": "#optionalmethod-1" + }, + "children": "optionalMethod" + }, + { + "span.tsd-signature-symbol": "?" + }, + { + "span.tsd-signature-symbol": "(" + }, + { + "span.tsd-kind-parameter": "filter" + }, + { + "span.tsd-signature-symbol": ":" + }, + " ", + { + "span.tsd-signature-type": "string" + }, + { + "span.tsd-signature-symbol": "," + }, + " ", + { + "span.tsd-kind-parameter": "args" + }, + { + "span.tsd-signature-symbol": ":" + }, + " ", + { + "span.tsd-signature-type": "string" + }, + { + "span.tsd-signature-symbol": "[]" + }, + { + "span.tsd-signature-symbol": ")" + }, + { + "span.tsd-signature-symbol": ":" + }, + " ", + { + "span.tsd-signature-type": "any" + }, + { + "span.tsd-signature-symbol": ";" + }, + { + "br": [] + }, + { + "span.tsd-signature-symbol": "}" + } + ] + }, + { + "aside.tsd-sources": { + "ul": { + "li": [ + "Defined in ", + { + "tag": "a", + "props": { + "href": "gh2995.ts" + }, + "children": "gh2995.ts:1" + } + ] + } + } + }, + { + "section.tsd-panel-group.tsd-index-group": { + "section.tsd-panel.tsd-index-panel": { + "tag": "details.tsd-index-content.tsd-accordion", + "props": { + "open": true + }, + "children": [ + { + "summary.tsd-accordion-summary.tsd-index-summary": { + "h5.tsd-index-heading.uppercase": "Index" + } + }, + { + "div.tsd-accordion-details": { + "section.tsd-index-section": [ + { + "h3.tsd-index-heading": "Methods" + }, + { + "div.tsd-index-list": [ + { + "tag": "a.tsd-index-link", + "props": { + "href": "#optionalmethod" + }, + "children": { + "span": [ + "optional", + { + "wbr": [] + }, + "Method?" + ] + } + }, + "\n" + ] + } + ] + } + } + ] + } + } + }, + { + "tag": "details.tsd-panel-group.tsd-member-group.tsd-accordion", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-Methods" + }, + "children": { + "h2": "Methods" + } + }, + { + "section": { + "section.tsd-panel.tsd-member": [ + { + "h3.tsd-anchor-link#optionalmethod": [ + { + "code.tsd-tag": "Optional" + }, + { + "span": [ + "optional", + { + "wbr": [] + }, + "Method" + ] + }, + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#optionalmethod", + "aria-label": "Permalink" + } + } + ] + }, + { + "ul.tsd-signatures": { + "li.": [ + { + "div.tsd-signature.tsd-anchor-link#optionalmethod-1": [ + { + "span.tsd-kind-call-signature": "optionalMethod" + }, + { + "span.tsd-signature-symbol": "?" + }, + { + "span.tsd-signature-symbol": "(" + }, + { + "span.tsd-kind-parameter": "filter" + }, + { + "span.tsd-signature-symbol": ":" + }, + " ", + { + "span.tsd-signature-type": "string" + }, + { + "span.tsd-signature-symbol": "," + }, + " ", + { + "span.tsd-kind-parameter": "args" + }, + { + "span.tsd-signature-symbol": ":" + }, + " ", + { + "span.tsd-signature-type": "string" + }, + { + "span.tsd-signature-symbol": "[]" + }, + { + "span.tsd-signature-symbol": ")" + }, + { + "span.tsd-signature-symbol": ":" + }, + " ", + { + "span.tsd-signature-type": "any" + }, + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#optionalmethod-1", + "aria-label": "Permalink" + } + } + ] + }, + { + "div.tsd-description": [ + { + "div.tsd-parameters": [ + { + "h4.tsd-parameters-title": "Parameters" + }, + { + "ul.tsd-parameter-list": [ + { + "li": { + "span": [ + { + "span.tsd-kind-parameter": "filter" + }, + ": ", + { + "span.tsd-signature-type": "string" + } + ] + } + }, + { + "li": { + "span": [ + { + "span.tsd-kind-parameter": "args" + }, + ": ", + { + "span.tsd-signature-type": "string" + }, + { + "span.tsd-signature-symbol": "[]" + } + ] + } + } + ] + } + ] + }, + { + "h4.tsd-returns-title": [ + "Returns ", + { + "span.tsd-signature-type": "any" + } + ] + }, + { + "aside.tsd-sources": { + "ul": { + "li": [ + "Defined in ", + { + "tag": "a", + "props": { + "href": "gh2995.ts" + }, + "children": "gh2995.ts:2" + } + ] + } + } + } + ] + } + ] + } + } + ] + } + } + ] + } + ] + }, + { + "div.col-sidebar": { + "div.page-menu": { + "tag": "details.tsd-accordion.tsd-page-navigation", + "props": { + "open": true + }, + "children": [ + { + "summary.tsd-accordion-summary": { + "h3": "On This Page" + } + }, + { + "div.tsd-accordion-details": { + "tag": "details.tsd-accordion.tsd-page-navigation-section", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-Methods" + }, + "children": "Methods" + }, + { + "div": { + "tag": "a", + "props": { + "href": "#optionalmethod" + }, + "children": { + "span": [ + "optional", + { + "wbr": [] + }, + "Method" + ] + } + } + } + ] + } + } + ] + } + } + } + ] +} diff --git a/src/test/renderer/specs/modules.json b/src/test/renderer/specs/modules.json index 21b6084dd..c8247517c 100644 --- a/src/test/renderer/specs/modules.json +++ b/src/test/renderer/specs/modules.json @@ -16,14 +16,11 @@ ] }, { - "section.tsd-panel.tsd-comment": [ - { - "div.tsd-comment.tsd-typography": "Module comment
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "section.tsd-panel.tsd-comment": { + "div.tsd-comment.tsd-typography": { + "p": "Module comment" } - ] + } }, { "tag": "details.tsd-panel-group.tsd-member-group.tsd-accordion", @@ -106,6 +103,52 @@ ] } }, + { + "dd.tsd-member-summary": [] + }, + { + "dt.tsd-member-summary#gh2982": { + "span.tsd-member-summary-name": [ + { + "tag": "a", + "props": { + "href": "modules/GH2982.json" + }, + "children": "GH2982" + }, + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#gh2982", + "aria-label": "Permalink" + } + } + ] + } + }, + { + "dd.tsd-member-summary": [] + }, + { + "dt.tsd-member-summary#gh3007": { + "span.tsd-member-summary-name": [ + { + "tag": "a", + "props": { + "href": "modules/GH3007.json" + }, + "children": "GH3007" + }, + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#gh3007", + "aria-label": "Permalink" + } + } + ] + } + }, { "dd.tsd-member-summary": [] } @@ -220,6 +263,29 @@ { "dd.tsd-member-summary": [] }, + { + "dt.tsd-member-summary#gh3014": { + "span.tsd-member-summary-name": [ + { + "tag": "a", + "props": { + "href": "classes/GH3014.json" + }, + "children": "GH3014" + }, + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#gh3014", + "aria-label": "Permalink" + } + } + ] + } + }, + { + "dd.tsd-member-summary": [] + }, { "dt.tsd-member-summary#modifiersclass": { "span.tsd-member-summary-name": [ @@ -333,6 +399,29 @@ { "dd.tsd-member-summary": [] }, + { + "dt.tsd-member-summary#gh2995": { + "span.tsd-member-summary-name": [ + { + "tag": "a", + "props": { + "href": "interfaces/gh2995.json" + }, + "children": "gh2995" + }, + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#gh2995", + "aria-label": "Permalink" + } + } + ] + } + }, + { + "dd.tsd-member-summary": [] + }, { "dt.tsd-member-summary#nonecategory": { "span.tsd-member-summary-name": [ @@ -493,6 +582,56 @@ ] } ] + }, + { + "tag": "details.tsd-panel-group.tsd-member-group.tsd-accordion", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-References" + }, + "children": { + "h2": "References" + } + }, + { + "dl.tsd-member-summaries": [ + { + "dt.tsd-member-summary#boxalias": { + "span.tsd-member-summary-name": [ + { + "span": "boxAlias" + }, + { + "span": " → " + }, + { + "tag": "a", + "props": { + "href": "functions/box.json" + }, + "children": "box" + }, + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#boxalias", + "aria-label": "Permalink" + } + } + ] + } + }, + { + "dd.tsd-member-summary": [] + } + ] + } + ] } ] }, @@ -551,21 +690,41 @@ "children": "Namespaces" }, { - "div": { - "tag": "a", - "props": { - "href": "#expandtype" + "div": [ + { + "tag": "a", + "props": { + "href": "#expandtype" + }, + "children": { + "span": [ + "Expand", + { + "wbr": [] + }, + "Type" + ] + } }, - "children": { - "span": [ - "Expand", - { - "wbr": [] - }, - "Type" - ] + { + "tag": "a", + "props": { + "href": "#gh2982" + }, + "children": { + "span": "GH2982" + } + }, + { + "tag": "a", + "props": { + "href": "#gh3007" + }, + "children": { + "span": "GH3007" + } } - } + ] } ] }, @@ -640,6 +799,15 @@ ] } }, + { + "tag": "a", + "props": { + "href": "#gh3014" + }, + "children": { + "span": "GH3014" + } + }, { "tag": "a", "props": { @@ -719,6 +887,15 @@ ] } }, + { + "tag": "a", + "props": { + "href": "#gh2995" + }, + "children": { + "span": "gh2995" + } + }, { "tag": "a", "props": { @@ -821,6 +998,38 @@ } } ] + }, + { + "tag": "details.tsd-accordion.tsd-page-navigation-section", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-References" + }, + "children": "References" + }, + { + "div": { + "tag": "a", + "props": { + "href": "#boxalias" + }, + "children": { + "span": [ + "box", + { + "wbr": [] + }, + "Alias" + ] + } + } + } + ] } ] } diff --git a/src/test/renderer/specs/modules/ExpandType.NestedBehavior1.json b/src/test/renderer/specs/modules/ExpandType.NestedBehavior1.json index b6c548382..c78078397 100644 --- a/src/test/renderer/specs/modules/ExpandType.NestedBehavior1.json +++ b/src/test/renderer/specs/modules/ExpandType.NestedBehavior1.json @@ -36,11 +36,6 @@ } ] }, - { - "section.tsd-panel.tsd-comment": { - "div.tsd-comment.tsd-typography": [] - } - }, { "tag": "details.tsd-panel-group.tsd-member-group.tsd-accordion", "props": { @@ -145,7 +140,13 @@ "href": "#aexpanded" }, "children": { - "span": "AExpanded" + "span": [ + "A", + { + "wbr": [] + }, + "Expanded" + ] } }, { diff --git a/src/test/renderer/specs/modules/ExpandType.json b/src/test/renderer/specs/modules/ExpandType.json index 5e9c63ab3..dc9662dd9 100644 --- a/src/test/renderer/specs/modules/ExpandType.json +++ b/src/test/renderer/specs/modules/ExpandType.json @@ -332,7 +332,13 @@ "href": "#aexpanded" }, "children": { - "span": "AExpanded" + "span": [ + "A", + { + "wbr": [] + }, + "Expanded" + ] } }, { @@ -341,7 +347,13 @@ "href": "#bexpanded" }, "children": { - "span": "BExpanded" + "span": [ + "B", + { + "wbr": [] + }, + "Expanded" + ] } }, { diff --git a/src/test/renderer/specs/modules/GH2982.json b/src/test/renderer/specs/modules/GH2982.json new file mode 100644 index 000000000..40c28d9dc --- /dev/null +++ b/src/test/renderer/specs/modules/GH2982.json @@ -0,0 +1,208 @@ +{ + "div.container.container-main": [ + { + "div.col-content": [ + { + "div.tsd-page-title": [ + { + "tag": "ul.tsd-breadcrumb", + "props": { + "aria-label": "Breadcrumb" + }, + "children": { + "li": { + "tag": "a", + "props": { + "href": "", + "aria-current": "page" + }, + "children": "GH2982" + } + } + }, + { + "h1": "Namespace GH2982" + } + ] + }, + { + "tag": "details.tsd-panel-group.tsd-member-group.tsd-accordion", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-Interfaces" + }, + "children": { + "h2": "Interfaces" + } + }, + { + "dl.tsd-member-summaries": [ + { + "dt.tsd-member-summary#tmxdatanode": { + "span.tsd-member-summary-name": [ + { + "tag": "a", + "props": { + "href": "../interfaces/GH2982.TMXDataNode.json" + }, + "children": "TMXDataNode" + }, + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#tmxdatanode", + "aria-label": "Permalink" + } + } + ] + } + }, + { + "dd.tsd-member-summary": [] + } + ] + } + ] + }, + { + "tag": "details.tsd-panel-group.tsd-member-group.tsd-accordion", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-Type Aliases" + }, + "children": { + "h2": "Type Aliases" + } + }, + { + "dl.tsd-member-summaries": [ + { + "dt.tsd-member-summary#tmxnode": { + "span.tsd-member-summary-name": [ + { + "tag": "a", + "props": { + "href": "../types/GH2982.TMXNode.json" + }, + "children": "TMXNode" + }, + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#tmxnode", + "aria-label": "Permalink" + } + } + ] + } + }, + { + "dd.tsd-member-summary": [] + } + ] + } + ] + } + ] + }, + { + "div.col-sidebar": { + "div.page-menu": { + "tag": "details.tsd-accordion.tsd-page-navigation", + "props": { + "open": true + }, + "children": [ + { + "summary.tsd-accordion-summary": { + "h3": "On This Page" + } + }, + { + "div.tsd-accordion-details": [ + { + "tag": "details.tsd-accordion.tsd-page-navigation-section", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-Interfaces" + }, + "children": "Interfaces" + }, + { + "div": { + "tag": "a", + "props": { + "href": "#tmxdatanode" + }, + "children": { + "span": [ + "TMX", + { + "wbr": [] + }, + "Data", + { + "wbr": [] + }, + "Node" + ] + } + } + } + ] + }, + { + "tag": "details.tsd-accordion.tsd-page-navigation-section", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-Type Aliases" + }, + "children": "Type Aliases" + }, + { + "div": { + "tag": "a", + "props": { + "href": "#tmxnode" + }, + "children": { + "span": [ + "TMX", + { + "wbr": [] + }, + "Node" + ] + } + } + } + ] + } + ] + } + ] + } + } + } + ] +} diff --git a/src/test/renderer/specs/modules/GH3007.json b/src/test/renderer/specs/modules/GH3007.json new file mode 100644 index 000000000..f409f158f --- /dev/null +++ b/src/test/renderer/specs/modules/GH3007.json @@ -0,0 +1,244 @@ +{ + "div.container.container-main": [ + { + "div.col-content": [ + { + "div.tsd-page-title": [ + { + "tag": "ul.tsd-breadcrumb", + "props": { + "aria-label": "Breadcrumb" + }, + "children": { + "li": { + "tag": "a", + "props": { + "href": "", + "aria-current": "page" + }, + "children": "GH3007" + } + } + }, + { + "h1": "Namespace GH3007" + } + ] + }, + { + "tag": "details.tsd-panel-group.tsd-member-group.tsd-accordion", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-Classes" + }, + "children": { + "h2": "Classes" + } + }, + { + "dl.tsd-member-summaries": [ + { + "dt.tsd-member-summary#dombase": { + "span.tsd-member-summary-name": [ + { + "tag": "a", + "props": { + "href": "../classes/GH3007.DOMBase.json" + }, + "children": "DOMBase" + }, + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#dombase", + "aria-label": "Permalink" + } + } + ] + } + }, + { + "dd.tsd-member-summary": [] + }, + { + "dt.tsd-member-summary#domclass": { + "span.tsd-member-summary-name": [ + { + "tag": "a", + "props": { + "href": "../classes/GH3007.DOMClass.json" + }, + "children": "DOMClass" + }, + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#domclass", + "aria-label": "Permalink" + } + } + ] + } + }, + { + "dd.tsd-member-summary": [] + } + ] + } + ] + }, + { + "tag": "details.tsd-panel-group.tsd-member-group.tsd-accordion", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-Interfaces" + }, + "children": { + "h2": "Interfaces" + } + }, + { + "dl.tsd-member-summaries": [ + { + "dt.tsd-member-summary#domiterable": { + "span.tsd-member-summary-name": [ + { + "tag": "a", + "props": { + "href": "../interfaces/GH3007.DOMIterable.json" + }, + "children": "DOMIterable" + }, + { + "tag": "a.tsd-anchor-icon", + "props": { + "href": "#domiterable", + "aria-label": "Permalink" + } + } + ] + } + }, + { + "dd.tsd-member-summary": [] + } + ] + } + ] + } + ] + }, + { + "div.col-sidebar": { + "div.page-menu": { + "tag": "details.tsd-accordion.tsd-page-navigation", + "props": { + "open": true + }, + "children": [ + { + "summary.tsd-accordion-summary": { + "h3": "On This Page" + } + }, + { + "div.tsd-accordion-details": [ + { + "tag": "details.tsd-accordion.tsd-page-navigation-section", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-Classes" + }, + "children": "Classes" + }, + { + "div": [ + { + "tag": "a", + "props": { + "href": "#dombase" + }, + "children": { + "span": [ + "DOM", + { + "wbr": [] + }, + "Base" + ] + } + }, + { + "tag": "a", + "props": { + "href": "#domclass" + }, + "children": { + "span": [ + "DOM", + { + "wbr": [] + }, + "Class" + ] + } + } + ] + } + ] + }, + { + "tag": "details.tsd-accordion.tsd-page-navigation-section", + "props": { + "open": true + }, + "children": [ + { + "tag": "summary.tsd-accordion-summary", + "props": { + "data-key": "section-Interfaces" + }, + "children": "Interfaces" + }, + { + "div": { + "tag": "a", + "props": { + "href": "#domiterable" + }, + "children": { + "span": [ + "DOM", + { + "wbr": [] + }, + "Iterable" + ] + } + } + } + ] + } + ] + } + ] + } + } + } + ] +} diff --git a/src/test/renderer/specs/types/ExpandType.AExpanded.json b/src/test/renderer/specs/types/ExpandType.AExpanded.json index 8b3b95b61..054638787 100644 --- a/src/test/renderer/specs/types/ExpandType.AExpanded.json +++ b/src/test/renderer/specs/types/ExpandType.AExpanded.json @@ -36,11 +36,6 @@ } ] }, - { - "section.tsd-panel.tsd-comment": { - "div.tsd-comment.tsd-typography": [] - } - }, { "div.tsd-signature": [ { @@ -61,7 +56,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -86,7 +81,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -111,7 +106,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -271,7 +266,7 @@ { "div.tsd-type-declaration": [ { - "h4": "Type declaration" + "h4": "Type Declaration" }, { "ul.tsd-parameters": { @@ -290,10 +285,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "A
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "A" + } } ] } diff --git a/src/test/renderer/specs/types/ExpandType.BExpanded.json b/src/test/renderer/specs/types/ExpandType.BExpanded.json index e8eff5cf4..146e2c691 100644 --- a/src/test/renderer/specs/types/ExpandType.BExpanded.json +++ b/src/test/renderer/specs/types/ExpandType.BExpanded.json @@ -56,7 +56,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -81,7 +81,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -106,7 +106,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -318,7 +318,7 @@ { "div.tsd-type-declaration": [ { - "h4": "Type declaration" + "h4": "Type Declaration" }, { "ul.tsd-parameters": { @@ -337,10 +337,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "B
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "B" + } } ] } diff --git a/src/test/renderer/specs/types/ExpandType.Expandable.json b/src/test/renderer/specs/types/ExpandType.Expandable.json index be39fc09a..9a12bb136 100644 --- a/src/test/renderer/specs/types/ExpandType.Expandable.json +++ b/src/test/renderer/specs/types/ExpandType.Expandable.json @@ -56,7 +56,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -185,10 +185,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "A
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "A" + } }, { "aside.tsd-sources": { diff --git a/src/test/renderer/specs/types/ExpandType.Expandable2.json b/src/test/renderer/specs/types/ExpandType.Expandable2.json index 1660b2262..5adbf8dbe 100644 --- a/src/test/renderer/specs/types/ExpandType.Expandable2.json +++ b/src/test/renderer/specs/types/ExpandType.Expandable2.json @@ -56,7 +56,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -185,10 +185,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "C
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "C" + } }, { "aside.tsd-sources": { diff --git a/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AExpanded.json b/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AExpanded.json index 678a54354..95b96b709 100644 --- a/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AExpanded.json +++ b/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AExpanded.json @@ -45,11 +45,6 @@ } ] }, - { - "section.tsd-panel.tsd-comment": { - "div.tsd-comment.tsd-typography": [] - } - }, { "div.tsd-signature": [ { @@ -70,7 +65,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -95,7 +90,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -120,7 +115,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -332,7 +327,7 @@ { "div.tsd-type-declaration": [ { - "h4": "Type declaration" + "h4": "Type Declaration" }, { "ul.tsd-parameters": { @@ -351,10 +346,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "B
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "B" + } } ] } diff --git a/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AllExpanded.json b/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AllExpanded.json index 69dd59a7a..df4424c35 100644 --- a/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AllExpanded.json +++ b/src/test/renderer/specs/types/ExpandType.NestedBehavior1.AllExpanded.json @@ -65,7 +65,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -90,7 +90,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -115,7 +115,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -275,7 +275,7 @@ { "div.tsd-type-declaration": [ { - "h4": "Type declaration" + "h4": "Type Declaration" }, { "ul.tsd-parameters": { @@ -294,10 +294,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "A
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "A" + } } ] } @@ -359,7 +358,7 @@ { "div.tsd-type-declaration": [ { - "h4": "Type declaration" + "h4": "Type Declaration" }, { "ul.tsd-parameters": { @@ -378,10 +377,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "B
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "B" + } } ] } @@ -443,7 +441,7 @@ { "div.tsd-type-declaration": [ { - "h4": "Type declaration" + "h4": "Type Declaration" }, { "ul.tsd-parameters": { @@ -462,10 +460,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "C
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "C" + } } ] } diff --git a/src/test/renderer/specs/types/GH2982.TMXNode.json b/src/test/renderer/specs/types/GH2982.TMXNode.json new file mode 100644 index 000000000..31febec59 --- /dev/null +++ b/src/test/renderer/specs/types/GH2982.TMXNode.json @@ -0,0 +1,120 @@ +{ + "div.container.container-main": [ + { + "div.col-content": [ + { + "div.tsd-page-title": [ + { + "tag": "ul.tsd-breadcrumb", + "props": { + "aria-label": "Breadcrumb" + }, + "children": [ + { + "li": { + "tag": "a", + "props": { + "href": "../modules/GH2982.json" + }, + "children": "GH2982" + } + }, + { + "li": { + "tag": "a", + "props": { + "href": "", + "aria-current": "page" + }, + "children": "TMXNode" + } + } + ] + }, + { + "h1": "Type Alias TMXNodeType alias with nested properties
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "section.tsd-panel.tsd-comment": { + "div.tsd-comment.tsd-typography": { + "p": "Type alias with nested properties" } - ] + } }, { "div.tsd-signature": [ @@ -55,7 +52,7 @@ { "br": [] }, - " ", + " ", { "tag": "a.tsd-kind-property", "props": { @@ -73,7 +70,7 @@ { "br": [] }, - " ", + " ", { "span.tsd-kind-property": "anotherValue" }, @@ -90,7 +87,7 @@ { "br": [] }, - " ", + " ", { "span.tsd-kind-property": "emptyObject" }, @@ -107,7 +104,7 @@ { "br": [] }, - " ", + " ", { "span.tsd-kind-property": "moreOptions" }, @@ -139,7 +136,7 @@ { "br": [] }, - " ", + " ", { "span.tsd-kind-property": "value" }, @@ -156,7 +153,7 @@ { "br": [] }, - " ", + " ", { "span.tsd-signature-symbol": "}" }, @@ -181,7 +178,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:85" + "children": "index.ts:88" } ] } @@ -274,7 +271,7 @@ { "br": [] }, - " ", + " ", { "span.tsd-kind-property": "anotherValue" }, @@ -291,7 +288,7 @@ { "br": [] }, - " ", + " ", { "span.tsd-kind-property": "emptyObject" }, @@ -308,7 +305,7 @@ { "br": [] }, - " ", + " ", { "span.tsd-kind-property": "moreOptions" }, @@ -340,7 +337,7 @@ { "br": [] }, - " ", + " ", { "span.tsd-kind-property": "value" }, @@ -365,7 +362,7 @@ { "div.tsd-type-declaration": [ { - "h4": "Type declaration" + "h4": "Type Declaration" }, { "ul.tsd-parameters": [ @@ -388,10 +385,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "Another value
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "Another value" + } } ] }, @@ -444,10 +440,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "More options
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "More options" + } } ] }, @@ -470,10 +465,9 @@ ] }, { - "div.tsd-comment.tsd-typography": "Value
\n" - }, - { - "div.tsd-comment.tsd-typography": [] + "div.tsd-comment.tsd-typography": { + "p": "Value" + } } ] } @@ -491,7 +485,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:86" + "children": "index.ts:89" } ] } diff --git a/src/test/renderer/specs/types/UnionComments.json b/src/test/renderer/specs/types/UnionComments.json index 470df7d50..aabbcc333 100644 --- a/src/test/renderer/specs/types/UnionComments.json +++ b/src/test/renderer/specs/types/UnionComments.json @@ -50,7 +50,7 @@ { "div.tsd-type-declaration": [ { - "h4": "Type declaration" + "h4": "Type Declaration" }, { "ul": [ @@ -60,7 +60,9 @@ "span.tsd-signature-type": "\"abc\"" }, { - "div.tsd-comment.tsd-typography": "Commentary on abc
\n" + "div.tsd-comment.tsd-typography": { + "p": "Commentary on abc" + } } ] }, @@ -70,7 +72,9 @@ "span.tsd-signature-type": "\"def\"" }, { - "div.tsd-comment.tsd-typography": "Commentary on def
\n" + "div.tsd-comment.tsd-typography": { + "p": "Commentary on def" + } } ] } @@ -88,7 +92,7 @@ "props": { "href": "index.ts" }, - "children": "index.ts:99" + "children": "index.ts:102" } ] } diff --git a/src/test/renderer/testRendererUtils.ts b/src/test/renderer/testRendererUtils.ts index bb501f703..14632fd4b 100644 --- a/src/test/renderer/testRendererUtils.ts +++ b/src/test/renderer/testRendererUtils.ts @@ -1,10 +1,11 @@ import { type Reflection, resetReflectionID } from "#models"; -import { loadTestHighlighter } from "#node-utils"; +import { HtmlAttributeParser, loadTestHighlighter, ParserState } from "#node-utils"; import { rm } from "node:fs/promises"; import { DefaultTheme, KindRouter, PageEvent, PageKind, type RenderTemplate } from "../../lib/output/index.js"; import { type JsxChildren, type JsxElement, JsxFragment } from "../../lib/utils-common/jsx.elements.js"; import { Raw } from "../../lib/utils-common/jsx.js"; import { getConverter2App, getConverter2Project } from "../programs.js"; +import { assert } from "#utils"; function shouldIgnoreElement(el: JsxElement) { switch (el.tag) { @@ -46,13 +47,127 @@ function collapseStrings(data: any[]): unknown { return data; } +// This is a very hacky html parser only intended to handle output from markdown-it +// for inclusion in the renderer specs. Don't use it for anything that requires actual +// security. +function parseHtmlToJsxElement(html: string): JsxChildren[] { + const stack: JsxElement[] = []; + const output: JsxChildren[] = []; + let pos = 0; + let last = 0; + + function currentChildList() { + if (stack.length) { + return stack[stack.length - 1].children; + } + return output; + } + + function skipWs() { + while (pos < html.length && /\s/.test(html[pos])) ++pos; + } + + function takeWord() { + const start = pos; + while (pos < html.length && /[a-z0-9-]/i.test(html[pos])) ++pos; + return html.slice(start, pos); + } + + function startTag() { + assert(html[pos] === "<"); + + ++pos; + skipWs(); + + const tag = takeWord(); + + const parser = new HtmlAttributeParser(html, pos); + const props: Record
- {name} - {anchorIcon(context, anchor)} -
-