summaryrefslogtreecommitdiff
path: root/lib/rdoc/markup
diff options
context:
space:
mode:
authorNate Matykiewicz <natematykiewicz@gmail.com>2020-04-04 23:20:22 -0500
committeraycabta <aycabta@gmail.com>2020-05-24 23:47:24 +0900
commitc79f9ea606d072176533b22813653f9fd26940af (patch)
tree735a290506b78b86b515defe36db079dd0fa5be3 /lib/rdoc/markup
parentb10c9d201222b144df7d63660d1c731af53c4ae2 (diff)
[ruby/rdoc] Escape method names in HTML
The following is invalid HTML: <a href="Array.html#method-i-3C-3C"><code><<</code></a></p> Incorrect: <code><<</code> Correct: <code>&lt;&lt;</code> Fixes #761 https://github.com/ruby/rdoc/commit/b120d087f6
Diffstat (limited to 'lib/rdoc/markup')
-rw-r--r--lib/rdoc/markup/to_html_crossref.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/rdoc/markup/to_html_crossref.rb b/lib/rdoc/markup/to_html_crossref.rb
index 9314f04fae..4a3f028135 100644
--- a/lib/rdoc/markup/to_html_crossref.rb
+++ b/lib/rdoc/markup/to_html_crossref.rb
@@ -144,7 +144,7 @@ class RDoc::Markup::ToHtmlCrossref < RDoc::Markup::ToHtml
path = ref.as_href @from_path
if code and RDoc::CodeObject === ref and !(RDoc::TopLevel === ref)
- text = "<code>#{text}</code>"
+ text = "<code>#{CGI.escapeHTML text}</code>"
end
if path =~ /#/ then