File tree Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Expand file tree Collapse file tree 2 files changed +4
-12
lines changed Original file line number Diff line number Diff line change 1- /// <reference lib="deno.unstable" />
21import { diffToChanges } from "./diffToChanges.ts" ;
32import { assertEquals } from "../../deps/testing.ts" ;
43
Original file line number Diff line number Diff line change 11import { diffToChanges } from "./diffToChanges.ts" ;
22import 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" ;
104import type { Change } from "../../deps/socket.ts" ;
115import type { HeadData } from "./pull.ts" ;
126import { toTitleLc } from "../../title.ts" ;
@@ -64,15 +58,14 @@ export function* makeChanges(
6458const 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
You can’t perform that action at this time.
0 commit comments