X7ROOT File Manager
Current Path:
/opt/alt/ruby25/lib64/ruby/2.5.0/rdoc/markup
opt
/
alt
/
ruby25
/
lib64
/
ruby
/
2.5.0
/
rdoc
/
markup
/
ðŸ“
..
📄
attr_changer.rb
(424 B)
📄
attr_span.rb
(500 B)
📄
attribute_manager.rb
(7.95 KB)
📄
attributes.rb
(1.19 KB)
📄
blank_line.rb
(391 B)
📄
block_quote.rb
(252 B)
📄
document.rb
(3.15 KB)
📄
formatter.rb
(5.31 KB)
📄
formatter_test_case.rb
(16.76 KB)
📄
hard_break.rb
(446 B)
📄
heading.rb
(1.48 KB)
📄
include.rb
(829 B)
📄
indented_paragraph.rb
(906 B)
📄
inline.rb
(118 B)
📄
list.rb
(1.82 KB)
📄
list_item.rb
(1.71 KB)
📄
paragraph.rb
(493 B)
📄
parser.rb
(13.72 KB)
📄
pre_process.rb
(8.26 KB)
📄
raw.rb
(1000 B)
📄
rule.rb
(315 B)
📄
special.rb
(657 B)
📄
text_formatter_test_case.rb
(2.51 KB)
📄
to_ansi.rb
(2.05 KB)
📄
to_bs.rb
(1.63 KB)
📄
to_html.rb
(8.62 KB)
📄
to_html_crossref.rb
(4.33 KB)
📄
to_html_snippet.rb
(5.45 KB)
📄
to_joined_paragraph.rb
(1.1 KB)
📄
to_label.rb
(1.83 KB)
📄
to_markdown.rb
(3.62 KB)
📄
to_rdoc.rb
(6.15 KB)
📄
to_table_of_contents.rb
(1.68 KB)
📄
to_test.rb
(1.14 KB)
📄
to_tt_only.rb
(2.26 KB)
📄
verbatim.rb
(1.28 KB)
Editing: to_bs.rb
# frozen_string_literal: true ## # Outputs RDoc markup with hot backspace action! You will probably need a # pager to use this output format. # # This formatter won't work on 1.8.6 because it lacks String#chars. class RDoc::Markup::ToBs < RDoc::Markup::ToRdoc ## # Returns a new ToBs that is ready for hot backspace action! def initialize markup = nil super @in_b = false @in_em = false end ## # Sets a flag that is picked up by #annotate to do the right thing in # #convert_string def init_tags add_tag :BOLD, '+b', '-b' add_tag :EM, '+_', '-_' add_tag :TT, '' , '' # we need in_tt information maintained end ## # Makes heading text bold. def accept_heading heading use_prefix or @res << ' ' * @indent @res << @headings[heading.level][0] @in_b = true @res << attributes(heading.text) @in_b = false @res << @headings[heading.level][1] @res << "\n" end ## # Turns on or off special handling for +convert_string+ def annotate tag case tag when '+b' then @in_b = true when '-b' then @in_b = false when '+_' then @in_em = true when '-_' then @in_em = false end '' end ## # Calls convert_string on the result of convert_special def convert_special special convert_string super end ## # Adds bold or underline mixed with backspaces def convert_string string return string unless @in_b or @in_em chars = if @in_b then string.chars.map do |char| "#{char}\b#{char}" end elsif @in_em then string.chars.map do |char| "_\b#{char}" end end chars.join end end
Upload File
Create Folder