pict-docuserve 0.0.26 → 0.0.28

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.
@@ -5172,8 +5172,13 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
5172
5172
  }
5173
5173
  let tmpResult = pText;
5174
5174
 
5175
- // Inline code (backticks) - handle first to avoid interfering with other patterns
5176
- tmpResult = tmpResult.replace(/`([^`]+)`/g, '<code>$1</code>');
5175
+ // Extract inline code spans into placeholders so bold/italic regexes don't mangle their contents
5176
+ let tmpCodeSpans = [];
5177
+ tmpResult = tmpResult.replace(/`([^`]+)`/g, (pMatch, pCode) => {
5178
+ let tmpIndex = tmpCodeSpans.length;
5179
+ tmpCodeSpans.push('<code>' + pCode + '</code>');
5180
+ return '\x00CODEINLINE' + tmpIndex + '\x00';
5181
+ });
5177
5182
 
5178
5183
  // Inline LaTeX equations ($...$) — must be processed before other inline patterns
5179
5184
  // Match single $ delimiters that aren't adjacent to spaces (to avoid false positives with currency)
@@ -5208,6 +5213,11 @@ function _toPrimitive(t, r) { if ("object" != typeof t || !t) return t; var e =
5208
5213
  // Italic
5209
5214
  tmpResult = tmpResult.replace(/\*([^*]+)\*/g, '<em>$1</em>');
5210
5215
  tmpResult = tmpResult.replace(/_([^_]+)_/g, '<em>$1</em>');
5216
+
5217
+ // Restore inline code spans from placeholders
5218
+ tmpResult = tmpResult.replace(/\x00CODEINLINE(\d+)\x00/g, (pMatch, pIndex) => {
5219
+ return tmpCodeSpans[parseInt(pIndex)];
5220
+ });
5211
5221
  return tmpResult;
5212
5222
  }
5213
5223