mirror of
https://github.com/netbirdio/docs.git
synced 2026-04-16 07:26:35 +00:00
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:
@@ -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>
|
||||
<% });
|
||||
|
||||
Reference in New Issue
Block a user