Skip to content

Commit

Permalink
better handling of markdown-prefix hard-limit
Browse files Browse the repository at this point in the history
  • Loading branch information
MahdiBM committed Sep 15, 2023
1 parent fa46a53 commit 7a15225
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions Lambdas/GHHooks/Extensions/String+Document.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ extension String {
.format(options: .default)
.trimmingForMarkdown()
.markdownUnicodesPrefix(maxVisualLength)
.unicodesPrefix(hardLimit)
let document2 = Document(parsing: prefixed)
var paragraphCounter = ParagraphCounter()
paragraphCounter.visit(document2)
Expand All @@ -42,7 +41,6 @@ extension String {
.format(options: .default)
.trimmingForMarkdown()
.markdownUnicodesPrefix(maxVisualLength)
.unicodesPrefix(hardLimit)
var document3 = Document(parsing: prefixed2)
if let last = Array(document3.blockChildren).last,
last is Heading {
Expand All @@ -51,10 +49,9 @@ extension String {
.format(options: .default)
.trimmingForMarkdown()
.markdownUnicodesPrefix(maxVisualLength)
.unicodesPrefix(hardLimit)
}

return prefixed2
return prefixed2.unicodesPrefix(hardLimit)
}

private func trimmingForMarkdown() -> String {
Expand Down

0 comments on commit 7a15225

Please sign in to comment.