Skip to content

Commit 4490b0c

Browse files
committed
apply white-space property to correct element when enabling pre-wrap
1 parent 7a419e0 commit 4490b0c

File tree

2 files changed

+17
-10
lines changed

2 files changed

+17
-10
lines changed

preview-src/index.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -122,13 +122,14 @@ Eu mea munere vituperata constituam.
122122
|===
123123
|Input | Output | Example
124124

125-
m|"foo\nbar"
125+
m|"foo\nbar\nbaz"
126126
l|foo
127127
bar
128+
baz
128129
a|
129130
[,ruby]
130131
----
131-
puts "foo\nbar"
132+
puts "foo\nbar\nbaz"
132133
----
133134
|===
134135

src/css/doc.css

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -237,6 +237,10 @@
237237
}
238238
}
239239

240+
.doc table.tableblock pre {
241+
font-size: inherit;
242+
}
243+
240244
.doc table.tableblock + * {
241245
margin-top: 1.5rem;
242246
}
@@ -635,7 +639,7 @@
635639
.doc .literalblock .title,
636640
.doc .listingblock .title,
637641
.doc .openblock .title,
638-
.doc .tableblock caption {
642+
.doc table.tableblock caption {
639643
color: var(--caption-font-color);
640644
font-size: calc(16 / var(--rem-base) * 1rem);
641645
font-weight: var(--caption-font-weight);
@@ -744,13 +748,7 @@
744748
margin-top: 0;
745749
}
746750

747-
/* NEEDS REVIEW prevent pre in table from causing article to exceed bounds */
748-
.doc .tableblock pre,
749-
.doc .listingblock.wrap pre {
750-
white-space: pre-wrap;
751-
}
752-
753-
.doc pre.highlight code,
751+
.doc pre code,
754752
.doc .listingblock pre:not(.highlight),
755753
.doc .literalblock pre {
756754
background: var(--pre-background);
@@ -760,6 +758,14 @@
760758
padding: 0.75rem;
761759
}
762760

761+
/* NEEDS REVIEW prevent pre in table from causing article to exceed bounds */
762+
.doc .listingblock.wrap pre code,
763+
.doc .listingblock.wrap pre:not(.highlight),
764+
.doc table.tableblock pre code,
765+
.doc table.tableblock pre:not(.highlight) {
766+
white-space: pre-wrap;
767+
}
768+
763769
.doc pre.highlight {
764770
position: relative;
765771
}

0 commit comments

Comments
 (0)