diff options
author | Jacob Schatz <jschatz@gitlab.com> | 2016-08-19 14:00:47 +0000 |
---|---|---|
committer | Ruben Davila <rdavila84@gmail.com> | 2016-08-19 15:37:30 -0500 |
commit | 24477045f0ade0f758d180b6ed15818eb2cbfaa2 (patch) | |
tree | 0e7a8b5ca9127db254b1904c022f0d4570d46418 | |
parent | f81dd64f13e5e36c075a42a5411640127b94727b (diff) | |
download | gitlab-ce-24477045f0ade0f758d180b6ed15818eb2cbfaa2.tar.gz |
Merge branch 'scroll-code-blocks' into 'master'
Wrap single lines of code; horizontally scroll multi-line code blocks
## What does this MR do?
Original problem: code blocks were wrapping in issue body
* Multi-line code blocks (```) should scroll horizontally
* Single lines of code (`) should wrap
## Why was this MR needed?
Inconsistent scrolling vs wrapping behavior
## What are the relevant issue numbers?
Closes #19619
## Screenshots (if relevant)
![Screen_Shot_2016-08-04_at_2.32.30_PM](/uploads/a4abcc81b57ffaa8dc8ce2b70a24bc21/Screen_Shot_2016-08-04_at_2.32.30_PM.png)
See merge request !5675
-rw-r--r-- | CHANGELOG | 1 | ||||
-rw-r--r-- | app/assets/stylesheets/framework/typography.scss | 10 | ||||
-rw-r--r-- | app/assets/stylesheets/pages/detail_page.scss | 7 |
3 files changed, 10 insertions, 8 deletions
diff --git a/CHANGELOG b/CHANGELOG index 3705c8b9e36..d7f9e3fa71f 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -129,6 +129,7 @@ v 8.11.0 (unreleased) - Sensible state specific default sort order for issues and merge requests !5453 (tomb0y) - Fix bug where destroying a namespace would not always destroy projects - Fix RequestProfiler::Middleware error when code is reloaded in development + - Allow horizontal scrolling of code blocks in issue body - Catch what warden might throw when profiling requests to re-throw it - Avoid commit lookup on diff_helper passing existing local variable to the helper method - Add description to new_issue email and new_merge_request_email in text/plain content type. !5663 (dixpac) diff --git a/app/assets/stylesheets/framework/typography.scss b/app/assets/stylesheets/framework/typography.scss index 8659604cb8b..06874a993fa 100644 --- a/app/assets/stylesheets/framework/typography.scss +++ b/app/assets/stylesheets/framework/typography.scss @@ -14,12 +14,20 @@ margin-top: 0; } + // Single code lines should wrap code { font-family: $monospace_font; - white-space: pre; + white-space: pre-wrap; word-wrap: normal; } + // Multi-line code blocks should scroll horizontally + pre { + code { + white-space: pre; + } + } + kbd { display: inline-block; padding: 3px 5px; diff --git a/app/assets/stylesheets/pages/detail_page.scss b/app/assets/stylesheets/pages/detail_page.scss index 1b389d83525..4d9c73c6840 100644 --- a/app/assets/stylesheets/pages/detail_page.scss +++ b/app/assets/stylesheets/pages/detail_page.scss @@ -34,11 +34,4 @@ } } } - - .wiki { - code { - white-space: pre-wrap; - word-break: keep-all; - } - } } |