fiberx-backend-toolkit 0.0.68 → 0.0.69

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.
@@ -332,15 +332,22 @@ class InputTransformerUtil {
332
332
  if (!html) {
333
333
  return html;
334
334
  }
335
- return html
336
- // Remove line breaks and tabs
335
+ const preserved = [];
336
+ // Preserve sensitive blocks
337
+ html = html.replace(/<(pre|code|textarea)[^>]*>[\s\S]*?<\/\1>/gi, (match) => {
338
+ preserved.push(match);
339
+ return `___PRESERVE_${preserved.length - 1}___`;
340
+ });
341
+ html = html
337
342
  .replace(/[\n\r\t]+/g, " ")
338
- // Remove spaces between tags
339
343
  .replace(/>\s+</g, "><")
340
- // Collapse multiple spaces (but keep single space)
341
344
  .replace(/\s{2,}/g, " ")
342
- // Trim start and end
343
345
  .trim();
346
+ // Restore preserved blocks
347
+ preserved.forEach((block, i) => {
348
+ html = html.replace(`___PRESERVE_${i}___`, block);
349
+ });
350
+ return html;
344
351
  }
345
352
  }
346
353
  exports.default = InputTransformerUtil;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fiberx-backend-toolkit",
3
- "version": "0.0.68",
3
+ "version": "0.0.69",
4
4
  "description": "A TypeScript backend toolkit providing shared domain logic, infrastructure helpers, and utilities for FiberX server-side applications and services.",
5
5
  "type": "commonjs",
6
6
  "main": "./dist/index.js",