diff options
author | Ralph Amissah <ralph@amissah.com> | 2013-12-02 23:16:24 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2013-12-02 23:16:24 -0500 |
commit | 85ec6bab386b1e9b1ccbcab1fd97e6529b020032 (patch) | |
tree | 8fb513d342d11cd2cca54ce3256e12559b36db78 /lib/sisu/v5/shared_txt.rb | |
parent | v5: dal_endnotes, removed a space that should no longer be necessary (diff) |
v5: minor code related to line-breaks
Diffstat (limited to 'lib/sisu/v5/shared_txt.rb')
-rw-r--r-- | lib/sisu/v5/shared_txt.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/sisu/v5/shared_txt.rb b/lib/sisu/v5/shared_txt.rb index 8e8e7edb..0e3b6018 100644 --- a/lib/sisu/v5/shared_txt.rb +++ b/lib/sisu/v5/shared_txt.rb @@ -64,12 +64,14 @@ module SiSU_TextUtils def initialize(para='',n_char_max=76,n_indent=0,n_hang=nil) @para,@n_char_max,@n_indent=para,n_char_max,n_indent @n_char_max_extend = n_char_max - @br="\n" @n_hang=n_hang ? n_hang : @n_indent end + def break_line + "\n" + end def line_wrap space=' ' - spaces_indent,spaces_hang="#{@br}#{space*@n_indent}",space*@n_hang + spaces_indent,spaces_hang="#{break_line}#{space*@n_indent}",space*@n_hang line=0 out=[] out[line]='' |