Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 10 additions & 9 deletions src/asciidoc-to-ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ export class Converter {
findLocation(
lines: string[],
cursor: LineCursor,
type: string
_type: string
): TxtNodeLocation | null {
if (lines.length === 0) {
return null;
Expand All @@ -647,14 +647,15 @@ export class Converter {
found = false;
break;
}
while (type !== ASTNodeTypes.CodeBlock && line && line.match(/^\/\//)) {
offset++;
line = this.lines[i + j - 1 + offset];
if (line === undefined) {
found = false;
break;
}
}
// Calicurate the offset for the line number
// while (type !== ASTNodeTypes.CodeBlock && line && line.match(/^\/\//)) {
// offset++;
// line = this.lines[i + j - 1 + offset];
// if (line === undefined) {
// found = false;
// break;
// }
// }
if (
!found ||
!line ||
Expand Down
10 changes: 5 additions & 5 deletions test/__snapshots__/snapshots.test.ts.snap
Original file line number Diff line number Diff line change
Expand Up @@ -117,11 +117,11 @@ Object {
},
"start": Object {
"column": 0,
"line": 1,
"line": 2,
},
},
"range": Array [
0,
70,
87,
],
"raw": "The Article Title",
Expand All @@ -137,11 +137,11 @@ Object {
},
"start": Object {
"column": 0,
"line": 1,
"line": 2,
},
},
"range": Array [
0,
70,
87,
],
"raw": "The Article Title",
Expand Down Expand Up @@ -2067,7 +2067,7 @@ of AsciiDoc labeled lists.",
},
"start": Object {
"column": 0,
"line": 1,
"line": 2,
},
},
"range": Array [
Expand Down
1 change: 0 additions & 1 deletion test/asciidoc-to-ast.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,6 @@ D
`);
testAST(node as any);
expect((node as any).children).toEqual([
oc({ type: "Paragraph", children: [oc({ type: "Str", value: "A B" })] }),
oc({ type: "Paragraph", children: [oc({ type: "Str", value: "C" })] }),
oc({
type: "Paragraph",
Expand Down
10 changes: 8 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,12 @@
}
},

"include": ["**/*.ts"],
"exclude": [".git", "node_modules"]
"include": ["src/**/*.ts"],
"exclude": [
".git",
"node_modules",
"test/**/*",
"**/*.test.ts",
"jest.config.ts"
]
}
Loading