Skip to content

Commit d4f95f0

Browse files
committed
Update wpkit_summarized to do the same
1 parent e217826 commit d4f95f0

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

Modules/Sources/WordPressKitModels/NSString+Summary.swift

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ extension NSString {
1717
let characterSet = CharacterSet(charactersIn: "\n")
1818

1919
return (self as String).strippingGutenbergContentForExcerpt()
20+
.replacingOccurrences(of: "<br\\s*/?>", with: " ", options: .regularExpression)
2021
.strippingShortcodes()
2122
.makePlainText()
2223
.trimmingCharacters(in: characterSet)

Modules/Sources/WordPressShared/Utility/GutenbergExcerptGenerator.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public struct GutenbergExcerptGenerator {
1616

1717
// Extract content while convering <br>, <br/>, <br /> to newlines first
1818
let rawText = String(content[tagEnd.upperBound..<pEnd.lowerBound])
19-
.replacingOccurrences(of: "<br\\s*/?>", with: "\n", options: .regularExpression)
19+
.replacingOccurrences(of: "<br\\s*/?>", with: " ", options: .regularExpression)
2020

2121
// Remove HTML tags AND shortcodes in one pass
2222
let range = NSRange(rawText.startIndex..., in: rawText)

0 commit comments

Comments
 (0)