Skip to content

Commit f97d5f5

Browse files
authored
Merge pull request #6 from toshimaru/modify-generated-html
Modify generated html
2 parents 7391aa2 + 57c92d8 commit f97d5f5

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

lib/rdoc/generator/template/rails/_context.rhtml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@
101101
<td>=</td>
102102
<td class="attr-value"><%= h const.value %></td>
103103
</tr>
104-
<% if const.comment %>
104+
<% if const.comment.present? %>
105105
<tr valign='top'>
106106
<td>&nbsp;</td>
107107
<td colspan="2" class="attr-desc"><%= const.description.strip %></td>
@@ -174,16 +174,16 @@
174174
<% if source_code %>
175175
<details class="method__source">
176176
<summary>
177-
<span class="label">Source code</span>
177+
<span class="label">📝 Source code</span>
178178
</summary>
179179

180180
<pre><code class="ruby"><%= source_code %></code></pre>
181181
<% if source_url %>
182-
<a href="<%= source_url %>" target="_blank" class="github_url">See on GitHub</a>
182+
<a href="<%= source_url %>" target="_blank" class="github_url">🔎 See on GitHub</a>
183183
<% end %>
184184
</details>
185185
<% elsif source_url %>
186-
<a href="<%= source_url %>" target="_blank" class="github_url">See on GitHub</a>
186+
<a href="<%= source_url %>" target="_blank" class="github_url">🔎 See on GitHub</a>
187187
<% end %>
188188
</div>
189189
<% end %><%# methods.each %>

lib/sdoc/helpers.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,6 @@ def method_source_code_and_url(rdoc_method)
3131
source_url = github_url(Regexp.last_match(1), line: Regexp.last_match(2))
3232
end
3333

34-
[rdoc_method.instance_of?(RDoc::GhostMethod) ? nil : source_code, source_url]
34+
[rdoc_method.instance_of?(RDoc::GhostMethod) ? nil : h(source_code), source_url]
3535
end
3636
end

0 commit comments

Comments
 (0)