Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions Sources/Markdown/Walker/Walkers/MarkupFormatter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -425,21 +425,20 @@ public struct MarkupFormatter: MarkupWalker {
*/
func linePrefix(for element: Markup) -> String {
var prefix = formattingOptions.customLinePrefix
var unorderedListCount = 0
var orderedListCount = 0
var listCount = 0
for element in element.parentalChain {
if element is BlockQuote {
prefix += "> "
} else if element is UnorderedList {
if unorderedListCount > 0 {
if listCount > 0 {
prefix += " "
}
unorderedListCount += 1
listCount += 1
} else if element is OrderedList {
if orderedListCount > 0 {
if listCount > 0 {
prefix += " "
}
orderedListCount += 1
listCount += 1
} else if !(element is ListItem),
let parentListItem = element.parent as? ListItem {
/*
Expand Down