Skip to content

Commit

Permalink
Filter out non empty newlines for readXmlElementAsSingleSummary
Browse files Browse the repository at this point in the history
  • Loading branch information
nojaf committed Nov 29, 2023
1 parent 5cd8a87 commit 148153d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/FSharp.Formatting.ApiDocs/GenerateModel.fs
Original file line number Diff line number Diff line change
Expand Up @@ -1849,7 +1849,10 @@ module internal SymbolReader =
/// Wraps the summary content in a <pre> tag if it is multiline and has different column indentations.
let readXmlElementAsSingleSummary (e: XElement) =
let text = e.Value
let nonEmptyLines = e.Value.Split([| '\n' |], StringSplitOptions.RemoveEmptyEntries)

let nonEmptyLines =
e.Value.Split([| '\n' |], StringSplitOptions.RemoveEmptyEntries)
|> Array.filter (String.IsNullOrWhiteSpace >> not)

if nonEmptyLines.Length = 1 then
nonEmptyLines.[0]
Expand Down

0 comments on commit 148153d

Please sign in to comment.