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" />
2
1
import { diffToChanges } from "./diffToChanges.ts" ;
3
2
import { assertEquals } from "../../deps/testing.ts" ;
4
3
Original file line number Diff line number Diff line change 1
1
import { diffToChanges } from "./diffToChanges.ts" ;
2
2
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" ;
10
4
import type { Change } from "../../deps/socket.ts" ;
11
5
import type { HeadData } from "./pull.ts" ;
12
6
import { toTitleLc } from "../../title.ts" ;
@@ -64,15 +58,14 @@ export function* makeChanges(
64
58
const findLinksAndImage = (
65
59
text : string ,
66
60
) : [ 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 ) {
70
63
case "codeBlock" :
71
64
case "title" :
72
65
return [ ] ;
73
66
case "line" :
74
67
case "table" :
75
- return [ convertToBlock ( pack ) ] ;
68
+ return block ;
76
69
}
77
70
} ) ;
78
71
You can’t perform that action at this time.
0 commit comments