First pass on fixes

This commit is contained in:
Piotr Osiewicz 2025-08-19 14:23:59 +02:00
parent 5826d89b97
commit 2f3be75fc7
269 changed files with 1593 additions and 2574 deletions

View file

@ -34,16 +34,14 @@ impl HandleTag for ParagraphHandler {
tag: &HtmlElement,
writer: &mut MarkdownWriter,
) -> StartTagOutcome {
if tag.is_inline() && writer.is_inside("p") {
if let Some(parent) = writer.current_element_stack().iter().last() {
if !(parent.is_inline()
if tag.is_inline() && writer.is_inside("p")
&& let Some(parent) = writer.current_element_stack().iter().last()
&& !(parent.is_inline()
|| writer.markdown.ends_with(' ')
|| writer.markdown.ends_with('\n'))
{
writer.push_str(" ");
}
}
}
if tag.tag() == "p" {
writer.push_blank_line()