@vakra-dev/reader 0.1.0 → 0.1.1

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.d.ts CHANGED
@@ -851,6 +851,8 @@ declare function isDaemonRunning(port?: number): Promise<boolean>;
851
851
  *
852
852
  * Simple conversion without any headers, metadata, or formatting wrappers.
853
853
  * Returns clean markdown content ready for LLM consumption.
854
+ *
855
+ * Uses supermarkdown (Rust-based) for high-performance conversion.
854
856
  */
855
857
  declare function htmlToMarkdown(html: string): string;
856
858
  /**
package/dist/index.js CHANGED
@@ -14,21 +14,15 @@ import { ConnectionToHeroCore } from "@ulixee/hero";
14
14
  import pLimit from "p-limit";
15
15
 
16
16
  // src/formatters/markdown.ts
17
- import TurndownService from "turndown";
18
- var turndownService = new TurndownService({
19
- headingStyle: "atx",
20
- hr: "---",
21
- bulletListMarker: "-",
22
- codeBlockStyle: "fenced",
23
- fence: "```",
24
- emDelimiter: "*",
25
- strongDelimiter: "**",
26
- linkStyle: "inlined",
27
- linkReferenceStyle: "full"
28
- });
17
+ import { convert } from "@vakra-dev/supermarkdown";
29
18
  function htmlToMarkdown(html) {
30
19
  try {
31
- return turndownService.turndown(html);
20
+ return convert(html, {
21
+ headingStyle: "atx",
22
+ bulletMarker: "-",
23
+ codeFence: "`",
24
+ linkStyle: "inline"
25
+ });
32
26
  } catch (error) {
33
27
  console.warn("Error converting HTML to Markdown:", error);
34
28
  return html.replace(/<[^>]*>/g, "").trim();
@@ -1928,7 +1922,7 @@ var EngineOrchestrator = class {
1928
1922
  return true;
1929
1923
  }
1930
1924
  if (error instanceof HttpError) {
1931
- return error.statusCode === 403 || error.statusCode === 429 || error.statusCode >= 500;
1925
+ return error.statusCode === 403 || error.statusCode === 404 || error.statusCode === 429 || error.statusCode >= 500;
1932
1926
  }
1933
1927
  if (error instanceof EngineUnavailableError) {
1934
1928
  return true;