1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Fix constant value extraction. Escape HTML in constant values

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@5815 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
dave 2004-02-23 21:10:42 +00:00
parent f84f600ffa
commit 261d63ae46
3 changed files with 21 additions and 3 deletions

View file

@ -1,3 +1,13 @@
Tue Feb 24 06:08:47 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/parsers/parse_rb.rb (RDoc::RubyParser::parse_constant):
Start collecting text of constant values earlier: was missing
values in output if there was no space after '='
Tue Feb 24 06:08:25 2004 Dave Thomas <dave@pragprog.com>
* lib/rdoc/generators/html_generator.rb: Escape contant values.
Tue Feb 24 03:45:06 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_config.c (ossl_config_each): add new method

View file

@ -348,7 +348,7 @@ module Generators
@context.constants.map do |co|
res = {
'name' => co.name,
'value' => co.value
'value' => CGI.escapeHTML(co.value)
}
res['desc'] = markup(co.comment, true) if co.comment && !co.comment.empty?
res

View file

@ -1510,6 +1510,10 @@ module RDoc
read
end
def peek_read
@read.join('')
end
NORMAL = "::"
SINGLE = "<<"
@ -1814,6 +1818,10 @@ module RDoc
return
end
nest = 0
get_tkread
tk = get_tk
if tk.kind_of? TkGT
unget_tk(tk)
@ -1821,11 +1829,10 @@ module RDoc
return
end
nest = 0
get_tkread
loop do
puts("Param: #{tk}, #{@scanner.continue} " +
"#{@scanner.lex_state} #{nest}") if $DEBUG
case tk
when TkSEMICOLON
break
@ -1846,6 +1853,7 @@ module RDoc
end
tk = get_tk
end
res = get_tkread.tr("\n", " ").strip
res = "" if res == ";"
con = Constant.new(name, res, comment)