diff options
author | Ralph Amissah <ralph@amissah.com> | 2014-07-01 00:33:49 -0400 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2014-07-01 00:33:52 -0400 |
commit | 954419b5ae79efb032d28b145ee40d0b61c80c23 (patch) | |
tree | 6076bfea3c7a0d93c387a9d4d3bfe1e479aac6d3 /lib/sisu/v5/txt_shared.rb | |
parent | sisu.org minor (diff) |
v5: merge what was sisu_6.0.8 into v5
* ao,
* syntax, able optionally to indicate the language syntax of a code block
* syntax, introduce box text block/group
* syntax, introduce tics quotes markup (blockquote equivalent)
* docbook,
* ocn & footnote numbers (as xml comments)
* metadata header (docinfo)
* quotes (blockquote)
* tables
* images
* code block
* vim syntax, add
* code block, language syntax, optional
* box block
* quote block
Diffstat (limited to 'lib/sisu/v5/txt_shared.rb')
-rw-r--r-- | lib/sisu/v5/txt_shared.rb | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/sisu/v5/txt_shared.rb b/lib/sisu/v5/txt_shared.rb index 0b6c1953..2bf633ea 100644 --- a/lib/sisu/v5/txt_shared.rb +++ b/lib/sisu/v5/txt_shared.rb @@ -62,8 +62,8 @@ =end module SiSU_TextUtils class Wrap - 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 + def initialize(para='',n_char_max=76,n_indent=0,n_hang=nil,post='') + @para,@n_char_max,@n_indent,@post,=para,n_char_max,n_indent,post @n_char_max_extend = n_char_max @n_hang=n_hang ? n_hang : @n_indent end @@ -110,7 +110,10 @@ module SiSU_TextUtils end @oldword=word if word =~/\S+/ end - spaces_hang + out.join(spaces_indent) + post=(@post.empty?) \ + ? '' + : "\n" + (' '*@n_indent) +@post + spaces_hang + out.join(spaces_indent) + post end def line_wrap_indent1 @n_indent,@n_hang=2,2 |