We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent def3e65 commit 33b360cCopy full SHA for 33b360c
lib/jsduck/source_file.rb
@@ -47,7 +47,9 @@ def html_filename=(html_filename)
47
# Returns source code as HTML with lines starting doc-comments specially marked.
48
def to_html
49
linenr = 0
50
- return @contents.lines.map do |line|
+ lines = []
51
+ # Use #each_line instead of #lines to support Ruby 1.6
52
+ @contents.each_line do |line|
53
linenr += 1;
54
line = CGI.escapeHTML(line)
55
# wrap the line in as many spans as there are links to this line number.
@@ -56,8 +58,9 @@ def to_html
56
58
line = "<span id='#{id(doc)}'>#{line}</span>"
57
59
end
60
- line
- end.join()
61
+ lines << line
62
+ end
63
+ lines.join()
64
65
66
def id(doc)
0 commit comments