Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 2 additions & 6 deletions Sources/DocCHTML/MarkdownRenderer+Parameters.swift
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,7 @@ package extension MarkdownRenderer {
for parameter in parameterInfo {
// name
items.append(
.element(named: "dt", children: [
.element(named: "code", children: [.text(parameter.name)])
])
.element(named: "dt", children: [.text(parameter.name)])
)
// description
items.append(
Expand Down Expand Up @@ -131,9 +129,7 @@ package extension MarkdownRenderer {
let index = (offset + primaryOnlyIndices.count(where: { $0 < offset })) * 2
items.insert(contentsOf: [
// Name
.element(named: "dt", children: [
.element(named: "code", children: [.text(parameter.name)])
], attributes: ["class": "\(secondary.language.id)-only"]),
.element(named: "dt", children: [.text(parameter.name)], attributes: ["class": "\(secondary.language.id)-only"]),
// Description
.element(named: "dd", children: parameter.content.map { visit($0) }, attributes: ["class": "\(secondary.language.id)-only"])
], at: index)
Expand Down
44 changes: 11 additions & 33 deletions Tests/DocCHTMLTests/MarkdownRenderer+PageElementsTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -131,17 +131,13 @@ struct MarkdownRenderer_PageElementsTests {
<a href="#Parameters">Parameters</a>
</h2>
<dl>
<dt>
<code>First</code>
</dt>
<dt>First</dt>
<dd>
<p>
Some <i>formatted</i> description with <code>code</code>
</p>
</dd>
<dt>
<code>Second</code>
</dt>
<dt>Second</dt>
<dd>
<p>
Some <b>other</b> <i>formatted</i> description</p>
Expand All @@ -154,16 +150,12 @@ struct MarkdownRenderer_PageElementsTests {
parameters.assertMatches(prettyFormatted: true, expectedXMLString: """
<h2>Parameters</h2>
<dl>
<dt>
<code>First</code>
</dt>
<dt>First</dt>
<dd>
<p>Some <i>formatted</i>description with <code>code</code>
</p>
</dd>
<dt>
<code>Second</code>
</dt>
<dt>Second</dt>
<dd>
<p>
Some <b>other</b> <i>formatted</i> description</p>
Expand Down Expand Up @@ -194,27 +186,19 @@ struct MarkdownRenderer_PageElementsTests {
<a href="#Parameters">Parameters</a>
</h2>
<dl>
<dt>
<code>FirstCommon</code>
</dt>
<dt>FirstCommon</dt>
<dd>
<p>Available in both languages</p>
</dd>
<dt class="swift-only">
<code>SwiftOnly</code>
</dt>
<dt class="swift-only">SwiftOnly</dt>
<dd class="swift-only">
<p>Only available in Swift</p>
</dd>
<dt>
<code>SecondCommon</code>
</dt>
<dt>SecondCommon</dt>
<dd>
<p>Also available in both languages</p>
</dd>
<dt class="occ-only">
<code>ObjectiveCOnly</code>
</dt>
<dt class="occ-only">ObjectiveCOnly</dt>
<dd class="occ-only">
<p>Only available in Objective-C</p>
</dd>
Expand Down Expand Up @@ -242,25 +226,19 @@ struct MarkdownRenderer_PageElementsTests {
<a href="#Parameters">Parameters</a>
</h2>
<dl class="swift-only">
<dt>
<code>First</code>
</dt>
<dt>First</dt>
<dd>
<p>Some description</p>
</dd>
</dl>
<dl class="data-only">
<dt>
<code>Third</code>
</dt>
<dt>Third</dt>
<dd>
<p>Some description</p>
</dd>
</dl>
<dl class="occ-only">
<dt>
<code>Second</code>
</dt>
<dt>Second</dt>
<dd>
<p>Some description</p>
</dd>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -347,15 +347,11 @@ final class FileWritingHTMLContentConsumerTests: XCTestCase {
</section>
<h2>Parameters</h2>
<dl>
<dt>
<code>first</code>
</dt>
<dt>first</dt>
<dd>
<p>Description of the <code>first</code> parameter.</p>
</dd>
<dt>
<code>second</code>
</dt>
<dt>second</dt>
<dd>
<p>Description of the <code>second</code> parameter.</p>
</dd>
Expand Down