@superinterface/react 3.17.3 → 3.18.0

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/index.js CHANGED
@@ -41550,6 +41550,15 @@ var MarkdownContext = /* @__PURE__ */ createContext6({
41550
41550
  var useMarkdownContext = function() {
41551
41551
  return useContext5(MarkdownContext);
41552
41552
  };
41553
+ // src/lib/markdown/escapeInvalidTagNames.ts
41554
+ var isValidTagName = function(tagName) {
41555
+ return /^[A-Za-z_][A-Za-z0-9_.:-]*$/.test(tagName);
41556
+ };
41557
+ var escapeInvalidTagNames = function(markdown) {
41558
+ return markdown.replace(/<([^\s>/]+)([^>]*)>/g, function(fullMatch, tagName) {
41559
+ return isValidTagName(tagName) ? fullMatch : fullMatch.replace(/</g, "&lt;").replace(/>/g, "&gt;");
41560
+ });
41561
+ };
41553
41562
  // ../../node_modules/react-error-boundary/dist/react-error-boundary.esm.js
41554
41563
  import { createContext as createContext7, Component, createElement, useContext as useContext6, useState as useState2, useMemo as useMemo8, forwardRef } from "react";
41555
41564
  var ErrorBoundaryContext = /* @__PURE__ */ createContext7(null);
@@ -41784,7 +41793,7 @@ var TextContent = function(t0) {
41784
41793
  ]);
41785
41794
  return [
41786
41795
  4,
41787
- compile(content2.text.value, {
41796
+ compile(escapeInvalidTagNames(content2.text.value), {
41788
41797
  outputFormat: "function-body",
41789
41798
  remarkPlugins: remarkPlugins,
41790
41799
  recmaPlugins: [