@hardlydifficult/text 1.0.16 → 1.0.17

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.
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Escapes markdown code fences by wrapping content with more backticks than it contains.
3
+ * If content has ```, wraps with ````. If content has ````, wraps with `````, etc.
4
+ */
5
+ export declare function escapeFence(content: string): {
6
+ fence: string;
7
+ content: string;
8
+ };
9
+ //# sourceMappingURL=escapeFence.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"escapeFence.d.ts","sourceRoot":"","sources":["../src/escapeFence.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG;IAC5C,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;CACjB,CAeA"}
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.escapeFence = escapeFence;
4
+ /**
5
+ * Escapes markdown code fences by wrapping content with more backticks than it contains.
6
+ * If content has ```, wraps with ````. If content has ````, wraps with `````, etc.
7
+ */
8
+ function escapeFence(content) {
9
+ let maxBackticks = 3; // Start with triple backticks (standard markdown fence)
10
+ // Find the longest sequence of consecutive backticks in the content
11
+ const backtickMatches = content.match(/`+/g);
12
+ if (backtickMatches) {
13
+ for (const match of backtickMatches) {
14
+ if (match.length >= maxBackticks) {
15
+ maxBackticks = match.length + 1;
16
+ }
17
+ }
18
+ }
19
+ const fence = "`".repeat(maxBackticks);
20
+ return { fence, content };
21
+ }
22
+ //# sourceMappingURL=escapeFence.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"escapeFence.js","sourceRoot":"","sources":["../src/escapeFence.ts"],"names":[],"mappings":";;AAIA,kCAkBC;AAtBD;;;GAGG;AACH,SAAgB,WAAW,CAAC,OAAe;IAIzC,IAAI,YAAY,GAAG,CAAC,CAAC,CAAC,wDAAwD;IAE9E,oEAAoE;IACpE,MAAM,eAAe,GAAG,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC;IAC7C,IAAI,eAAe,EAAE,CAAC;QACpB,KAAK,MAAM,KAAK,IAAI,eAAe,EAAE,CAAC;YACpC,IAAI,KAAK,CAAC,MAAM,IAAI,YAAY,EAAE,CAAC;gBACjC,YAAY,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;IACH,CAAC;IAED,MAAM,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,CAAC,CAAC;IACvC,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC;AAC5B,CAAC"}
package/dist/index.d.ts CHANGED
@@ -11,4 +11,5 @@ export { formatWithLineNumbers } from "./formatWithLineNumbers.js";
11
11
  export { formatYaml } from "./formatYaml.js";
12
12
  export { healYaml } from "./healYaml.js";
13
13
  export { Linker, createLinker, type LinkRule, type LinkHrefBuilder, type LinkMatchContext, type LinkerApplyOptions, type LinkerPlatform, } from "./linker.js";
14
+ export { escapeFence } from "./escapeFence.js";
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAC9E,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,eAAe,CAAC;AACrE,OAAO,EAAE,SAAS,EAAE,MAAM,gBAAgB,CAAC;AAC3C,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAC;AACvC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,oBAAoB,CAAC;AACvE,YAAY,EAAE,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,aAAa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KAAK,cAAc,GACpB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC"}
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.createLinker = exports.Linker = exports.healYaml = exports.formatYaml = exports.formatWithLineNumbers = exports.convertFormat = exports.FILE_TREE_DEFAULTS = exports.buildFileTree = exports.formatDuration = exports.slugify = exports.chunkText = exports.extractPlaceholders = exports.replaceTemplate = exports.formatErrorForLog = exports.formatError = exports.getErrorMessage = void 0;
3
+ exports.escapeFence = exports.createLinker = exports.Linker = exports.healYaml = exports.formatYaml = exports.formatWithLineNumbers = exports.convertFormat = exports.FILE_TREE_DEFAULTS = exports.buildFileTree = exports.formatDuration = exports.slugify = exports.chunkText = exports.extractPlaceholders = exports.replaceTemplate = exports.formatErrorForLog = exports.formatError = exports.getErrorMessage = void 0;
4
4
  var errors_js_1 = require("./errors.js");
5
5
  Object.defineProperty(exports, "getErrorMessage", { enumerable: true, get: function () { return errors_js_1.getErrorMessage; } });
6
6
  Object.defineProperty(exports, "formatError", { enumerable: true, get: function () { return errors_js_1.formatError; } });
@@ -28,4 +28,6 @@ Object.defineProperty(exports, "healYaml", { enumerable: true, get: function ()
28
28
  var linker_js_1 = require("./linker.js");
29
29
  Object.defineProperty(exports, "Linker", { enumerable: true, get: function () { return linker_js_1.Linker; } });
30
30
  Object.defineProperty(exports, "createLinker", { enumerable: true, get: function () { return linker_js_1.createLinker; } });
31
+ var escapeFence_js_1 = require("./escapeFence.js");
32
+ Object.defineProperty(exports, "escapeFence", { enumerable: true, get: function () { return escapeFence_js_1.escapeFence; } });
31
33
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;AAAA,yCAA8E;AAArE,4GAAA,eAAe,OAAA;AAAE,wGAA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"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hardlydifficult/text",
3
- "version": "1.0.16",
3
+ "version": "1.0.17",
4
4
  "main": "./dist/index.js",
5
5
  "types": "./dist/index.d.ts",
6
6
  "files": [