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