@marvalt/wparser 0.1.78 → 0.1.79

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.cjs CHANGED
@@ -1431,7 +1431,7 @@ function parseShortcodeAttrs(attrString) {
1431
1431
  function findShortcodes(text) {
1432
1432
  const shortcodes = [];
1433
1433
  // First, find closing tag pairs: [shortcode]content[/shortcode]
1434
- const closingTagRegex = /\[(\w+)(?:\s+([^\]]+))?\](.*?)\[\/\1\]/gs;
1434
+ const closingTagRegex = /\[([\w-]+)(?:\s+([^\]]+))?\](.*?)\[\/\1\]/gs;
1435
1435
  let match;
1436
1436
  const processedRanges = [];
1437
1437
  while ((match = closingTagRegex.exec(text)) !== null) {
@@ -1454,7 +1454,7 @@ function findShortcodes(text) {
1454
1454
  }
1455
1455
  // Then, find self-closing: [shortcode attr="value"]
1456
1456
  // Skip ranges already processed by closing tags
1457
- const selfClosingRegex = /\[(\w+)(?:\s+([^\]]+))?\]/g;
1457
+ const selfClosingRegex = /\[([\w-]+)(?:\s+([^\]]+))?\]/g;
1458
1458
  let selfClosingMatch;
1459
1459
  while ((selfClosingMatch = selfClosingRegex.exec(text)) !== null) {
1460
1460
  // Check if this match is within a processed range