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
1 change: 0 additions & 1 deletion browser/websocket/diffToChanges.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/// <reference lib="deno.unstable" />
import { diffToChanges } from "./diffToChanges.ts";
import { assertEquals } from "../../deps/testing.ts";

Expand Down
15 changes: 4 additions & 11 deletions browser/websocket/makeChanges.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
import { diffToChanges } from "./diffToChanges.ts";
import type { Line } from "../../deps/scrapbox.ts";
import {
Block,
convertToBlock,
Node,
packRows,
parseToRows,
} from "../../deps/scrapbox.ts";
import { Block, Node, parse } from "../../deps/scrapbox.ts";
import type { Change } from "../../deps/socket.ts";
import type { HeadData } from "./pull.ts";
import { toTitleLc } from "../../title.ts";
Expand Down Expand Up @@ -64,15 +58,14 @@ export function* makeChanges(
const findLinksAndImage = (
text: string,
): [string[], string[], string | null] => {
const rows = parseToRows(text);
const blocks = packRows(rows, { hasTitle: true }).flatMap((pack) => {
switch (pack.type) {
const blocks = parse(text, { hasTitle: true }).flatMap((block) => {
switch (block.type) {
case "codeBlock":
case "title":
return [];
case "line":
case "table":
return [convertToBlock(pack)];
return block;
}
});

Expand Down