@mintlify/common 1.0.1301 → 1.0.1303

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.
@@ -3,3 +3,4 @@ export * from './remark-utils.js';
3
3
  export * from './unicode-id.js';
4
4
  export * from './findExportedNode.js';
5
5
  export * from './node-text.js';
6
+ export * from './jsxParser.js';
@@ -3,3 +3,4 @@ export * from './remark-utils.js';
3
3
  export * from './unicode-id.js';
4
4
  export * from './findExportedNode.js';
5
5
  export * from './node-text.js';
6
+ export * from './jsxParser.js';
@@ -9,9 +9,10 @@ const normalize = (value) => Array.from(value)
9
9
  .filter((character) => character > ' ')
10
10
  .join('')
11
11
  .toLowerCase();
12
+ const localName = (name) => name.slice(name.lastIndexOf(':') + 1).toLowerCase();
12
13
  const targetsScriptableAttribute = (attributeName) => {
13
- const localName = attributeName.slice(attributeName.lastIndexOf(':') + 1);
14
- return SCRIPTABLE_TARGETS.has(localName) || localName.startsWith('on');
14
+ const name = localName(attributeName);
15
+ return SCRIPTABLE_TARGETS.has(name) || name.startsWith('on');
15
16
  };
16
17
  function isSafeSmilAttribute(attribute) {
17
18
  if (attribute.type === 'mdxJsxExpressionAttribute')
@@ -28,7 +29,7 @@ function isSafeSmilAttribute(attribute) {
28
29
  return value.startsWith('#');
29
30
  return !ANIMATION_VALUE_ATTRIBUTES.has(name) || !SCRIPTABLE_URL.test(value);
30
31
  }
31
- export const isUnsafeSmilElement = ({ name, attributes = [] }) => name != null && SMIL_ELEMENTS.has(name.toLowerCase()) && !attributes.every(isSafeSmilAttribute);
32
+ export const isUnsafeSmilElement = ({ name, attributes = [] }) => name != null && SMIL_ELEMENTS.has(localName(name)) && !attributes.every(isSafeSmilAttribute);
32
33
  export const remarkMdxRemoveUnsafeSmil = () => (tree) => {
33
34
  remove(tree, { cascade: false }, (node) => isMdxJsxElement(node) && isUnsafeSmilElement(node));
34
35
  };