浏览代码

fix: fix sourcemaps and circular dependencies (#2929)

Tony Brix 2 年之前
父节点
当前提交
eb4ce21127
共有 4 个文件被更改,包括 9 次插入8 次删除
  1. 4 4
      src/MarkedOptions.ts
  2. 2 2
      src/Renderer.ts
  3. 1 1
      src/Tokenizer.ts
  4. 2 1
      tsconfig.json

+ 4 - 4
src/MarkedOptions.ts

@@ -1,8 +1,8 @@
 import type { Token, Tokens, TokensList } from './Tokens.ts';
 import type { Token, Tokens, TokensList } from './Tokens.ts';
-import { _Parser } from './Parser.ts';
-import { _Lexer } from './Lexer.ts';
-import { _Renderer } from './Renderer.ts';
-import { _Tokenizer } from './Tokenizer.ts';
+import type { _Parser } from './Parser.ts';
+import type { _Lexer } from './Lexer.ts';
+import type { _Renderer } from './Renderer.ts';
+import type { _Tokenizer } from './Tokenizer.ts';
 
 
 export interface SluggerOptions {
 export interface SluggerOptions {
   /** Generates the next unique slug without updating the internal accumulator. */
   /** Generates the next unique slug without updating the internal accumulator. */

+ 2 - 2
src/Renderer.ts

@@ -4,7 +4,7 @@ import {
   escape
   escape
 } from './helpers.ts';
 } from './helpers.ts';
 import type { MarkedOptions } from './MarkedOptions.ts';
 import type { MarkedOptions } from './MarkedOptions.ts';
-import { Slugger } from './marked.ts';
+import type { _Slugger } from './Slugger.ts';
 
 
 /**
 /**
  * Renderer
  * Renderer
@@ -49,7 +49,7 @@ export class _Renderer {
     return html;
     return html;
   }
   }
 
 
-  heading(text: string, level: number, raw: string, slugger: Slugger): string {
+  heading(text: string, level: number, raw: string, slugger: _Slugger): string {
     if (this.options.headerIds) {
     if (this.options.headerIds) {
       const id = this.options.headerPrefix + slugger.slug(raw);
       const id = this.options.headerPrefix + slugger.slug(raw);
       return `<h${level} id="${id}">${text}</h${level}>\n`;
       return `<h${level} id="${id}">${text}</h${level}>\n`;

+ 1 - 1
src/Tokenizer.ts

@@ -5,7 +5,7 @@ import {
   escape,
   escape,
   findClosingBracket
   findClosingBracket
 } from './helpers.ts';
 } from './helpers.ts';
-import { _Lexer } from './Lexer.ts';
+import type { _Lexer } from './Lexer.ts';
 import type { Links, Tokens } from './Tokens.ts';
 import type { Links, Tokens } from './Tokens.ts';
 import type { MarkedOptions } from './MarkedOptions.ts';
 import type { MarkedOptions } from './MarkedOptions.ts';
 
 

+ 2 - 1
tsconfig.json

@@ -9,7 +9,8 @@
     "allowSyntheticDefaultImports": true,
     "allowSyntheticDefaultImports": true,
     "moduleResolution": "NodeNext",
     "moduleResolution": "NodeNext",
     "noImplicitAny": false,
     "noImplicitAny": false,
-    "allowImportingTsExtensions": true
+    "allowImportingTsExtensions": true,
+    "sourceMap": false
   },
   },
   "include": [
   "include": [
     "src/*.ts"
     "src/*.ts"