Sha256: bec3fd3676133eafa828fa635edf87233b6050d59ebf3fa0e88e33d016afd18c

Contents?: true

Size: 1.01 KB

Versions: 8

Compression:

Stored size: 1.01 KB

Contents

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

#
# 対象小説情報
# タイトル: デスマーチからはじまる異世界狂想曲
# 作者: 愛七ひろ
# URL: http://ncode.syosetu.com/n9902bn/
#
converter "n9902bn デスマーチからはじまる異世界狂想曲" do
  def before(io, text_type)
    super
  end

  def announce_line?(line)
    line =~ /^〉/
  end

  def after(io, text_type)
    buffer = StringIO.new
    just_before_line_is_announce = false
    io.each do |line|
      if announce_line?(line)
        unless just_before_line_is_announce
          if line.strip != ""
            buffer.puts
          end
        end
        just_before_line_is_announce = true
        buffer.puts "[#ゴシック体][#太字]#{line.rstrip}[#太字終わり][#ゴシック体終わり]"
      else
        if just_before_line_is_announce
          buffer.puts
        end
        just_before_line_is_announce = false
        buffer.puts line
      end
    end
    buffer
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
narou-1.7.1 preset/ncode.syosetu.com/n9902bn/converter.rb
narou-1.6.4 preset/ncode.syosetu.com/n9902bn/converter.rb
narou-1.6.3 preset/ncode.syosetu.com/n9902bn/converter.rb
narou-1.6.1 preset/ncode.syosetu.com/n9902bn/converter.rb
narou-1.6.0 preset/ncode.syosetu.com/n9902bn/converter.rb
narou-1.5.11 preset/ncode.syosetu.com/n9902bn/converter.rb
narou-1.5.10.1 preset/ncode.syosetu.com/n9902bn/converter.rb
narou-1.5.10 preset/ncode.syosetu.com/n9902bn/converter.rb