Ticket #50: BlueCloth-encode-code-double-escape.diff
| File BlueCloth-encode-code-double-escape.diff, 0.7 kB (added by ueno, 11 months ago) |
|---|
-
lib/bluecloth.rb
1025 1025 ### Escape any characters special to HTML and encode any characters special 1026 1026 ### to Markdown in a copy of the given +str+ and return it. 1027 1027 def encode_code( str, rs ) 1028 str.gsub( %r{&}, '&' ). 1029 gsub( %r{<}, '<' ). 1030 gsub( %r{>}, '>' ). 1031 gsub( CodeEscapeRegexp ) {|match| EscapeTable[match][:md5]} 1028 unless filter_html 1029 str = str.gsub( %r{&}, '&' ). 1030 gsub( %r{<}, '<' ). 1031 gsub( %r{>}, '>' ) 1032 end 1033 str.gsub( CodeEscapeRegexp ) {|match| EscapeTable[match][:md5]} 1032 1034 end 1033 1035 1034 1036
