Skip to content

Commit

Permalink
fix: Don't generate Pandoc Str nodes with empty string content
Browse files Browse the repository at this point in the history
  • Loading branch information
idreyn committed Jul 20, 2022
1 parent 768005d commit 27e4455
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/transform/util.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,10 @@ export const intersperse = (

export const textToStrSpace = (text: string): (Str | Space)[] =>
intersperse(
text.split(" ").map((word) => ({ type: "Str", content: word })),
text
.split(" ")
.filter((word) => word.length > 0)
.map((word) => ({ type: "Str", content: word })),
() => ({ type: "Space" })
);

Expand Down

0 comments on commit 27e4455

Please sign in to comment.