Escape MDX-specific characters in API templates and refine Navigation… (#638)

* Escape MDX-specific characters in API templates and refine NavigationAPI links

* Update API pages with v0.66.0

---------

Co-authored-by: netbirddev <dev@netbird.io>
This commit is contained in:
Maycon Santos
2026-02-26 16:28:00 +01:00
committed by GitHub
parent 8b7b458569
commit b35de5b477
32 changed files with 18602 additions and 110 deletions

View File

@@ -1,5 +1,4 @@
const template = `
export const title = '<%- tag %>'
<% operations.forEach(function(operation){ %>
@@ -8,14 +7,14 @@ export const title = '<%- tag %>'
<Row>
<Col>
<%- operation.description %>
<%- escapeMdx(operation.description) %>
<% if(operation.parameters && operation.parameters.filter((parameter) => parameter.in === 'path').length > 0){ %>
### Path Parameters
<Properties>
<% operation.parameters.filter((parameter) => parameter.in === 'path').forEach(function(parameter){ %>
<Property name="<%- parameter.name %>" type="string" required=\{true\}>
<%- parameter.description %>
</Property>
<%- escapeMdx(parameter.description) %>
</Property>
<% }); -%>
</Properties>
<% }; -%>
@@ -24,7 +23,7 @@ export const title = '<%- tag %>'
<Properties>
<% operation.parameters.filter((parameter) => parameter.in === 'query').forEach(function(parameter){ %>
<Property name="<%- parameter.name %>" type="<%- parameter.schema.type %>" required=\{false\}>
<%- parameter.description %>
<%- escapeMdx(parameter.description) %>
</Property>
<% }); -%>
</Properties>
@@ -76,7 +75,7 @@ function renderProperties(properties, required = [], depth = 0) {
</Properties>
</details>
<% } else { %>
<% if(value.description) { %><%- value.description %><% } %>
<% if(value.description) { %><%- escapeMdx(value.description) %><% } %>
<% } %>
</Property>
<% });