Sha256: d363e7a559363298650d7945bf8ffd0c50512456a334ac96cac9a2e8f311fd8b

Contents?: true

Size: 1.37 KB

Versions: 27

Compression:

Stored size: 1.37 KB

Contents

# -*- coding: utf-8 -*-

#
# 対象小説情報
# タイトル: ありふれた職業で世界最強
# 作者: 厨二好き/白米良
# URL: http://ncode.syosetu.com/n8611bv/
#
# 詳細については http://bit.ly/1vTEH04 を参照して下さい
#
converter "n8611bv ありふれた職業で世界最強" do
  def before(io, text_type)
    super
    io
  end

  def is_parameter?(line)
    line =~ /^ ?={5,}$/
  end

  def after(io, text_type)
    super
    return io unless text_type == "body"
    write_fp = StringIO.new
    parameter_opened = false
    io.each do |line|
      if is_parameter?(line)
        if parameter_opened
          write_fp.puts "==============================="
          write_fp.puts "[#ここで太字終わり]"
        else
          write_fp.puts "[#ここから太字]"
          write_fp.puts "==============================="
        end
        parameter_opened ^= true
      else
        write_fp.puts(line)
      end
    end
    if parameter_opened
      write_fp.puts "==============================="
      write_fp.puts "[#ここで太字終わり]"
    end

    write_fp.string.gsub!(/^~{5,}/, "    * * *")
    write_fp
  end
end

Version data entries

27 entries across 27 versions & 1 rubygems

Version Path
narou-3.9.1 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.9.0 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.8.2 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.8.1 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.8.0 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.7.2 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.7.1 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.7.0 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.6.0 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.5.1 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.5.0.1 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.5.0 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.4.8 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.4.7.1 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.4.7 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.4.6.1 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.4.6 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.4.5 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.4.3 preset/ncode.syosetu.com/n8611bv/converter.rb
narou-3.4.2 preset/ncode.syosetu.com/n8611bv/converter.rb