Skip to content

Commit 09995aa

Browse files
authored
Merge pull request #160 from takker99:fix-type-errors
fix: scrapbox-parserの破壊的変更に伴うエラー修正
2 parents 17677e4 + 4e784a1 commit 09995aa

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

browser/websocket/diffToChanges.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/// <reference lib="deno.unstable" />
21
import { diffToChanges } from "./diffToChanges.ts";
32
import { assertEquals } from "../../deps/testing.ts";
43

browser/websocket/makeChanges.ts

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
import { diffToChanges } from "./diffToChanges.ts";
22
import type { Line } from "../../deps/scrapbox.ts";
3-
import {
4-
Block,
5-
convertToBlock,
6-
Node,
7-
packRows,
8-
parseToRows,
9-
} from "../../deps/scrapbox.ts";
3+
import { Block, Node, parse } from "../../deps/scrapbox.ts";
104
import type { Change } from "../../deps/socket.ts";
115
import type { HeadData } from "./pull.ts";
126
import { toTitleLc } from "../../title.ts";
@@ -64,15 +58,14 @@ export function* makeChanges(
6458
const findLinksAndImage = (
6559
text: string,
6660
): [string[], string[], string | null] => {
67-
const rows = parseToRows(text);
68-
const blocks = packRows(rows, { hasTitle: true }).flatMap((pack) => {
69-
switch (pack.type) {
61+
const blocks = parse(text, { hasTitle: true }).flatMap((block) => {
62+
switch (block.type) {
7063
case "codeBlock":
7164
case "title":
7265
return [];
7366
case "line":
7467
case "table":
75-
return [convertToBlock(pack)];
68+
return block;
7669
}
7770
});
7871

0 commit comments

Comments
 (0)