Skip to content

Commit

Permalink
Merge pull request #887 from nojaf/fix-886
Browse files Browse the repository at this point in the history
Add scrollbar to long Namespace description
  • Loading branch information
nojaf authored Nov 30, 2023
2 parents 5cd8a87 + a0d2e44 commit 6e14439
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 3 deletions.
5 changes: 5 additions & 0 deletions RELEASE_NOTES.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# Changelog

## Unreleased

### Fixed
* Namespace description overflows content box. [#886](https://github.com/fsprojects/FSharp.Formatting/issues/886)

## 20.0.0-alpha-014 - 2023-11-22

### Added
Expand Down
14 changes: 12 additions & 2 deletions docs/content/fsdocs-default.css
Original file line number Diff line number Diff line change
Expand Up @@ -756,7 +756,9 @@ pre.fssnip.highlighted > code, table.pre .fssnip, table.pre .fssnip code {
}

/* Custom scrollbar styling */
body, aside, #menu-toggle .menu, table.pre, code, .fsdocs-entity-xmldoc > div > pre, div.fsdocs-summary > pre, dialog ul, div.fsdocs-tip {
body, aside, #menu-toggle .menu, table.pre, code,
.fsdocs-entity-xmldoc > div > pre, div.fsdocs-summary > pre,
dialog ul, div.fsdocs-tip, .fsdocs-xmldoc > pre {
overflow-x: auto;
max-width: 100%;

Expand All @@ -775,7 +777,9 @@ body, aside, #menu-toggle .menu, table.pre, code, .fsdocs-entity-xmldoc > div >
}
}

body, aside, #menu-toggle .menu, table.pre, code, .fsdocs-entity-xmldoc > div > pre, div.fsdocs-summary > pre, dialog ul, div.fsdocs-tip {
body, aside, #menu-toggle .menu, table.pre, code,
.fsdocs-entity-xmldoc > div > pre, div.fsdocs-summary > pre,
dialog ul, div.fsdocs-tip, .fsdocs-xmldoc > pre {
@media screen and (min-width: 768px) {
&::-webkit-scrollbar {
height: var(--spacing-200);
Expand Down Expand Up @@ -988,6 +992,12 @@ span[onmouseout] {
margin-top: 0;
}

.fsdocs-xmldoc {
& pre {
overflow-x: auto;
}
}

.table {
width: 100%;
table-layout: fixed;
Expand Down
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 6e14439

Please sign in to comment.