handle newline and html break conversions in mediawiki publishing
[scpubgit/System-Introspector-Report.git] / lib / System / Introspector / Report / Publish / MediaWiki / Parser.pm
index 4932353..d1e1359 100644 (file)
@@ -64,7 +64,13 @@ my $_collect_content = sub {
   my ($stream, $type) = @_;
   my @events;
   until ($stream->$_is_type(close => $type)) {
-    push @events, $stream->next;
+    my $next = $stream->next;
+    if ($next->{type} eq 'OPEN' and $next->{name} eq 'br') {
+      push @events, { type => 'TEXT', raw => "\n" };
+    }
+    else {
+      push @events, $next;
+    }
   }
   return HTML::Zoom->from_events(\@events)->to_html;
 };