diff options
author | Ralph Amissah <ralph@amissah.com> | 2009-12-19 16:44:00 -0500 |
---|---|---|
committer | Ralph Amissah <ralph@amissah.com> | 2009-12-19 16:44:00 -0500 |
commit | c55796e30e0aad7db8367d7a56dd80c9a278d2d5 (patch) | |
tree | 35c28fbfe619778e14f3cbaf0d7e3b737067be4c /lib/sisu/v1/dal_syntax.rb | |
parent | minor code adjustments (diff) |
param & dal, includes removal of older header markup, simplification to allow cleaner v1 & v2
Diffstat (limited to 'lib/sisu/v1/dal_syntax.rb')
-rw-r--r-- | lib/sisu/v1/dal_syntax.rb | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/lib/sisu/v1/dal_syntax.rb b/lib/sisu/v1/dal_syntax.rb index e917621a..c6bab08f 100644 --- a/lib/sisu/v1/dal_syntax.rb +++ b/lib/sisu/v1/dal_syntax.rb @@ -252,18 +252,12 @@ module SiSU_Syntax line.gsub!(/~\{(.+?)\}~/m,Mx[:en_a_o] + '\1' + Mx[:en_a_c]) line.gsub!(/~\[([^*+].+?)\]~/m,Mx[:en_b_o] + '* \1' + Mx[:en_b_c]) #default if markup does not specify line.gsub!(/~\[(.+?)\]~/m,Mx[:en_b_o] + '\1' + Mx[:en_b_c]) - if @md.subtitle and not @md.subtitle.empty? - if line =~/(?:by\s+)?(?:@creator|@author)/ - line.gsub!(/^(#{Mx[:lv_o]}1:\??#{Mx[:lv_c]})\s*@title\s+(?:(by\s+)?(?:@creator|@author))\s*$/,"\\1#{@md.title} - #{@md.subtitle},<br />\\2#{@md.author}") - else - line.gsub!(/^(#{Mx[:lv_o]}1:\??#{Mx[:lv_c]})\s*@title\s*$/,"\\1 #{@md.title} - #{@md.subtitle}") - end - else - if line =~/(?:by\s+)?(?:@creator|@author)/ - line.gsub!(/^(#{Mx[:lv_o]}1:\??#{Mx[:lv_c]})\s*@title\s+(?:(by\s+)?(?:@creator|@author))\s*$/,"\\1#{@md.title},<br />\\2#{@md.author}") - else - line.gsub!(/^(#{Mx[:lv_o]}1:\??#{Mx[:lv_c]})\s*@title\s*$/,"\\1 #{@md.title}") + if line =~/^#{Mx[:lv_o]}1:\S*?#{Mx[:lv_c]}/ + if @md.subtitle and not @md.subtitle.empty? + line.gsub!(/\s*@title\b/," #{@md.title} - #{@md.subtitle}") + else line.gsub!(/\s*@title\b/," #{@md.title}") end + line.gsub!(/\s+(?:@creator|@author)/,",<br />#{@md.author}") end line.gsub!(/^(1~\??) @title\s*$/,"\\1 #{@md.title} - #{@md.subtitle}") # line.gsub!(/^(#{Mx[:lv_o]}[23]:\??#{Mx[:lv_c]}) (?:(by\s+)?(?:@creator|@author))\s*$/,"\\1 \\2#{@md.author}") # |