Skip to content

Commit

Permalink
fix(hiccup-markdown): #156 undo trimming of element children
Browse files Browse the repository at this point in the history
- was wrongly introduced in 602510c
  • Loading branch information
postspectacular committed Nov 3, 2019
1 parent 12e445a commit ccc9d40
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/hiccup-markdown/src/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ const pop = (result: Fn2<FSMCtx, string, any>) => (
};

const collectChildren = (ctx: FSMCtx) => (
ctx.children!.push(ctx.body!.trim()), ctx.children!
ctx.children!.push(ctx.body), ctx.children!
);

const collect = (id: State) => (ctx: FSMCtx, buf: string[]): ParseResult => (
Expand Down
4 changes: 2 additions & 2 deletions packages/hiccup-markdown/test/parse.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ describe("parse", () => {
it("CRLF", () => {
assert.deepEqual(
[...iterator(parse(), `# hello\r\n\r\nworld\r\n\r\n`)],
[["h1", "hello"], ["p", "world"]]
[["h1", " hello "], ["p", "world "]]
);
});

Expand All @@ -22,7 +22,7 @@ describe("parse", () => {
["br"],
" two ",
["em", "lines"],
"."
". "
]
]
);
Expand Down

0 comments on commit ccc9d40

Please sign in to comment.