@mintlify/common 1.0.878 → 1.0.879
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rss/index.js +18 -0
- package/dist/tsconfig.build.tsbuildinfo +1 -1
- package/package.json +2 -2
package/dist/rss/index.js
CHANGED
|
@@ -47,6 +47,7 @@ const STANDARD_HTML_TAGS = new Set([
|
|
|
47
47
|
'figcaption',
|
|
48
48
|
'blockquote',
|
|
49
49
|
'pre',
|
|
50
|
+
'code',
|
|
50
51
|
]);
|
|
51
52
|
export const isNormalMarkdown = (node) => {
|
|
52
53
|
if (!node) {
|
|
@@ -179,7 +180,24 @@ const jsxToHtml = (node) => {
|
|
|
179
180
|
.join('');
|
|
180
181
|
return `<${tagName}${attrsStr}>${childrenStr}</${tagName}>`;
|
|
181
182
|
};
|
|
183
|
+
const stripCustomInlineJsx = (parent) => {
|
|
184
|
+
let i = 0;
|
|
185
|
+
while (i < parent.children.length) {
|
|
186
|
+
const child = parent.children[i];
|
|
187
|
+
if (child.type === 'mdxJsxTextElement' &&
|
|
188
|
+
!STANDARD_HTML_TAGS.has(child.name || '')) {
|
|
189
|
+
const jsxChildren = child.children;
|
|
190
|
+
parent.children.splice(i, 1, ...jsxChildren);
|
|
191
|
+
continue;
|
|
192
|
+
}
|
|
193
|
+
if ('children' in child) {
|
|
194
|
+
stripCustomInlineJsx(child);
|
|
195
|
+
}
|
|
196
|
+
i++;
|
|
197
|
+
}
|
|
198
|
+
};
|
|
182
199
|
const stringifyTreeForRSS = (tree) => {
|
|
200
|
+
stripCustomInlineJsx(tree);
|
|
183
201
|
return tree.children
|
|
184
202
|
.map((child) => {
|
|
185
203
|
if (child.type === 'mdxJsxFlowElement' || child.type === 'mdxJsxTextElement') {
|