Skip to content

Commit 6799379

Browse files
committed
fix: endpoint body handles properly internal links
1 parent 8cf6aca commit 6799379

11 files changed

+172
-146
lines changed

dist/rapidoc-min.js

Lines changed: 69 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rapidoc-min.js.gz

27 Bytes
Binary file not shown.

dist/rapidoc-min.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/rapidoc-min.js.map.gz

77 Bytes
Binary file not shown.

dist/rapidoc.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15858,6 +15858,11 @@ function headingRenderer(tagElementId) {
1585815858
fixRenderedAnchorLinks(renderer);
1585915859
return renderer;
1586015860
}
15861+
function linkRenderer() {
15862+
const renderer = new marked.Renderer();
15863+
fixRenderedAnchorLinks(renderer);
15864+
return renderer;
15865+
}
1586115866
function expandCollapseTagDescription(e) {
1586215867
const tagDescriptionEl = e.target.closest('.tag-container').querySelector('.tag-description');
1586315868
const tagIconEl = e.target.closest('.tag-container').querySelector('.tag-icon');
@@ -15907,7 +15912,7 @@ function expandedEndpointBodyTemplate(path, tagName = '', tagDescription = '') {
1590715912
<path d="M12 20h-6a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h8"></path><path d="M18 4v17"></path><path d="M15 18l3 3l3 -3"></path>
1590815913
</svg>
1590915914
<div class="tag-description collapsed" style="max-height:0px; overflow:hidden; margin-top:16px; border:1px solid var(--border-color)">
15910-
<div class="m-markdown" style="padding:8px"> ${unsafe_html_o(marked(tagDescription))}</div>
15915+
<div class="m-markdown" style="padding:8px"> ${unsafe_html_o(marked(tagDescription, { renderer: linkRenderer() }))}</div>
1591115916
</div>`
1591215917
: ''}
1591315918
</div>
@@ -15932,7 +15937,9 @@ function expandedEndpointBodyTemplate(path, tagName = '', tagDescription = '') {
1593215937
</div>
1593315938
`}
1593415939
<slot name="${path.elementId}"></slot>`}
15935-
${path.description ? lit_html_x `<div class="m-markdown"> ${unsafe_html_o(marked(path.description))}</div>` : ''}
15940+
${path.description ? lit_html_x `<div class="m-markdown">
15941+
${unsafe_html_o(marked(path.description, { renderer: linkRenderer() }))}
15942+
</div>` : ''}
1593615943
${pathSecurityTemplate.call(this, path.security)}
1593715944
${((_g = path.externalDocs) === null || _g === void 0 ? void 0 : _g.url) || ((_h = path.externalDocs) === null || _h === void 0 ? void 0 : _h.description)
1593815945
? lit_html_x `<div style="background-color:var(--bg3); padding:2px 8px 8px 8px; margin:8px 0; border-radius:var(--border-radius)">
@@ -19616,7 +19623,7 @@ JsonSchemaViewer = json_schema_viewer_decorate([
1961619623
/******/
1961719624
/******/ /* webpack/runtime/getFullHash */
1961819625
/******/ (() => {
19619-
/******/ __webpack_require__.h = () => ("cd7f7834d5c89831c7f9")
19626+
/******/ __webpack_require__.h = () => ("a7c2df33f5d46062d5be")
1962019627
/******/ })();
1962119628
/******/
1962219629
/******/ /* webpack/runtime/global */

dist/report.html

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

dist/types/templates/expanded-endpoint-template.d.ts.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
0 Bytes
Binary file not shown.

docs/rapidoc-min.js

Lines changed: 69 additions & 67 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/rapidoc.js

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15858,6 +15858,11 @@ function headingRenderer(tagElementId) {
1585815858
fixRenderedAnchorLinks(renderer);
1585915859
return renderer;
1586015860
}
15861+
function linkRenderer() {
15862+
const renderer = new marked.Renderer();
15863+
fixRenderedAnchorLinks(renderer);
15864+
return renderer;
15865+
}
1586115866
function expandCollapseTagDescription(e) {
1586215867
const tagDescriptionEl = e.target.closest('.tag-container').querySelector('.tag-description');
1586315868
const tagIconEl = e.target.closest('.tag-container').querySelector('.tag-icon');
@@ -15907,7 +15912,7 @@ function expandedEndpointBodyTemplate(path, tagName = '', tagDescription = '') {
1590715912
<path d="M12 20h-6a2 2 0 0 1 -2 -2v-12a2 2 0 0 1 2 -2h8"></path><path d="M18 4v17"></path><path d="M15 18l3 3l3 -3"></path>
1590815913
</svg>
1590915914
<div class="tag-description collapsed" style="max-height:0px; overflow:hidden; margin-top:16px; border:1px solid var(--border-color)">
15910-
<div class="m-markdown" style="padding:8px"> ${unsafe_html_o(marked(tagDescription))}</div>
15915+
<div class="m-markdown" style="padding:8px"> ${unsafe_html_o(marked(tagDescription, { renderer: linkRenderer() }))}</div>
1591115916
</div>`
1591215917
: ''}
1591315918
</div>
@@ -15932,7 +15937,9 @@ function expandedEndpointBodyTemplate(path, tagName = '', tagDescription = '') {
1593215937
</div>
1593315938
`}
1593415939
<slot name="${path.elementId}"></slot>`}
15935-
${path.description ? lit_html_x `<div class="m-markdown"> ${unsafe_html_o(marked(path.description))}</div>` : ''}
15940+
${path.description ? lit_html_x `<div class="m-markdown">
15941+
${unsafe_html_o(marked(path.description, { renderer: linkRenderer() }))}
15942+
</div>` : ''}
1593615943
${pathSecurityTemplate.call(this, path.security)}
1593715944
${((_g = path.externalDocs) === null || _g === void 0 ? void 0 : _g.url) || ((_h = path.externalDocs) === null || _h === void 0 ? void 0 : _h.description)
1593815945
? lit_html_x `<div style="background-color:var(--bg3); padding:2px 8px 8px 8px; margin:8px 0; border-radius:var(--border-radius)">
@@ -19616,7 +19623,7 @@ JsonSchemaViewer = json_schema_viewer_decorate([
1961619623
/******/
1961719624
/******/ /* webpack/runtime/getFullHash */
1961819625
/******/ (() => {
19619-
/******/ __webpack_require__.h = () => ("cd7f7834d5c89831c7f9")
19626+
/******/ __webpack_require__.h = () => ("a7c2df33f5d46062d5be")
1962019627
/******/ })();
1962119628
/******/
1962219629
/******/ /* webpack/runtime/global */

0 commit comments

Comments
 (0)