Skip to content

Commit 3be906b

Browse files
Add comment to explain why we are popping the ouput twice in the event of an ending paragraph tag.
1 parent 8773b86 commit 3be906b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/postprocessors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ pub fn remove_obsidian_comments(
129129
}
130130
Event::End(Tag::Paragraph) => {
131131
if output[output.len() - 2] == Event::Start(Tag::Paragraph) {
132+
// If the comment was the only item on the line remove the start and end paragraph events to remove the \n in the output file.
132133
output.pop();
133134
output.pop();
134135
}
@@ -140,7 +141,6 @@ pub fn remove_obsidian_comments(
140141
}
141142
}
142143
}
143-
144144
*events = output;
145145
PostprocessorResult::Continue
146146
}

0 commit comments

Comments
 (0)