Skip to content

Commit 5314a65

Browse files
committed
Add extra newlines around Union descriptions like we do for other multiline Markdown
1 parent 4651d03 commit 5314a65

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

src/renderSchema.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,9 @@ function renderSchema(schema, options) {
329329
})}</strong></td>`
330330
)
331331
if (desc) {
332-
printer(`<td valign="top">\n${desc}\n</td>`)
332+
printer('<td valign="top">')
333+
printer(`\n${desc}\n`)
334+
printer('</td>')
333335
} else {
334336
printer('<td></td>')
335337
}

test/fixtures/union-test-2.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,17 +115,21 @@ The `String` scalar type represents textual data, represented as UTF-8 character
115115
<tr>
116116
<td valign="top"><strong><a href="#dog">Dog</a></strong></td>
117117
<td valign="top">
118+
118119
*italic*
119120

120121
* list item 1
121122
* list item 2
122123
* list item 3
124+
123125
</td>
124126
</tr>
125127
<tr>
126128
<td valign="top"><strong><a href="#seal">Seal</a></strong></td>
127129
<td valign="top">
130+
128131
abcde
132+
129133
</td>
130134
</tr>
131135
</tbody>

test/fixtures/union-test.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -196,12 +196,15 @@ Either a `Person` or an `Organization`
196196
<tr>
197197
<td valign="top"><strong><a href="#person">Person</a></strong></td>
198198
<td valign="top">
199+
199200
A human being
201+
200202
</td>
201203
</tr>
202204
<tr>
203205
<td valign="top"><strong><a href="#organization">Organization</a></strong></td>
204206
<td valign="top">
207+
205208
A group of **persons** <em>working</em> together for a purpose
206209

207210
This is a more elaborate description
@@ -211,6 +214,7 @@ This is a more elaborate description
211214
* to see
212215
* if this markdown is properly
213216
* translated
217+
214218
</td>
215219
</tr>
216220
</tbody>

0 commit comments

Comments
 (0)