$92 GRAYBYTE WORDPRESS FILE MANAGER $50

SERVER : premium201.web-hosting.com #1 SMP Wed Mar 26 12:08:09 UTC 2025
SERVER IP : 172.67.217.254 | ADMIN IP 216.73.216.36
OPTIONS : CRL = ON | WGT = ON | SDO = OFF | PKEX = OFF
DEACTIVATED : NONE

/opt/alt/ruby34/share/gems/gems/rdoc-6.14.0/lib/rdoc/markup/

HOME
Current File : /opt/alt/ruby34/share/gems/gems/rdoc-6.14.0/lib/rdoc/markup//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

  ##
  # Prepares the visitor for consuming +list_item+

  def accept_list_item_start(list_item)
    type = @list_type.last

    case type
    when :NOTE, :LABEL then
      bullets = Array(list_item.label).map do |label|
        attributes(label).strip
      end.join "\n"

      bullets << ":\n" unless bullets.empty?

      @prefix = ' ' * @indent
      @indent += 2
      @prefix << bullets + (' ' * @indent)
    else
      bullet = type == :BULLET ? '*' :  @list_index.last.to_s + '.'
      @prefix = (' ' * @indent) + bullet.ljust(bullet.length + 1)
      width = bullet.length + 1
      @indent += width
    end
  end

  ##
  # Turns on or off regexp 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_regexp_handling

  def convert_regexp_handling(target)
    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


Current_dir [ NOT WRITEABLE ] Document_root [ NOT WRITEABLE ]


[ Back ]
NAME
SIZE
LAST TOUCH
USER
CAN-I?
FUNCTIONS
..
--
10 Feb 2026 9.34 AM
root / linksafe
0755
attr_changer.rb
0.413 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
attr_span.rb
0.655 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
attribute_manager.rb
10.049 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
attributes.rb
1.249 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
blank_line.rb
0.383 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
block_quote.rb
0.246 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
document.rb
3.155 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
formatter.rb
5.627 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
hard_break.rb
0.438 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
heading.rb
1.593 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
include.rb
0.812 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
indented_paragraph.rb
0.887 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
list.rb
1.82 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
list_item.rb
1.716 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
paragraph.rb
0.482 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
parser.rb
14.501 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
pre_process.rb
9.264 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
raw.rb
0.98 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
regexp_handling.rb
0.7 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
rule.rb
0.309 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
table.rb
1.121 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
to_ansi.rb
2.055 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
to_bs.rb
2.257 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
to_html.rb
10.594 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
to_html_crossref.rb
6.363 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
to_html_snippet.rb
5.518 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
to_joined_paragraph.rb
1.133 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
to_label.rb
1.844 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
to_markdown.rb
3.654 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
to_rdoc.rb
6.792 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
to_table_of_contents.rb
1.718 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
to_test.rb
1.139 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
to_tt_only.rb
2.286 KB
27 Jan 2026 4.00 PM
root / linksafe
0644
verbatim.rb
1.286 KB
27 Jan 2026 4.00 PM
root / linksafe
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025 CONTACT ME
Static GIF