##// END OF EJS Templates
Textile formatting:...
Jean-Philippe Lang -
r1202:a92cce385105
parent child
Show More
@@ -295,6 +295,7 class RedCloth < String
295 295 @pre_list = []
296 296 rip_offtags text
297 297 no_textile text
298 escape_html_tags text
298 299 hard_break text
299 300 unless @lite_mode
300 301 refs text
@@ -375,18 +376,18 class RedCloth < String
375 376 re =
376 377 case rtype
377 378 when :limit
378 /(\W)
379 /(^|[>\s])
379 380 (#{rcq})
380 381 (#{C})
381 382 (?::(\S+?))?
382 (\S.*?\S|\S)
383 ([^\s\-].*?[^\s\-]|\w)
383 384 #{rcq}
384 (?=\W)/x
385 (?=[[:punct:]]|\s|$)/x
385 386 else
386 387 /(#{rcq})
387 388 (#{C})
388 389 (?::(\S+))?
389 (\S.*?\S|\S)
390 ([^\s\-].*?[^\s\-]|\w)
390 391 #{rcq}/xm
391 392 end
392 393 [rc, ht, re, rtype]
@@ -1128,5 +1129,11 class RedCloth < String
1128 1129 end
1129 1130 end
1130 1131 end
1132
1133 ALLOWED_TAGS = %w(redpre pre)
1134
1135 def escape_html_tags(text)
1136 text.gsub!(%r{<((\/?)(\w+))}) {|m| ALLOWED_TAGS.include?($3) ? "<#{$1}" : "&lt;#{$1}" }
1137 end
1131 1138 end
1132 1139
General Comments 0
You need to be logged in to leave comments. Login now