Changeset 605

Show
Ignore:
Timestamp:
2007-06-05 13:10:23 (2 years ago)
Author:
gaspard
Message:

[new] wrote tests for new better zafu links (dash)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/parser/lib/rules/zazen.rb

    r512 r605  
    9292        eat $& 
    9393        # link inside the cms "":34 
    94         store @helper.make_link(:title=>$1,:id=>$2) 
     94        title, id = $1, $2 
     95        if id =~ /(.*)#(.*)/ 
     96          id, dash = $1, $2 
     97          dash = title if dash.blank? 
     98        end 
     99        store @helper.make_link(:title=>title,:id=>id,:dash=>dash) 
    95100      else 
    96101        flush @text[0..0] 
  • trunk/lib/parser/test/parser_test.rb

    r599 r605  
    5656  testfile :zafu, :zafu_asset, :zafu_insight, :zazen 
    5757  def test_single 
    58     do_test('zafu', 'form') 
     58    do_test('zazen', 'link_dash') 
    5959  end 
    6060   
  • trunk/lib/parser/test/zazen.yml

    r599 r605  
    123123  src: '"":23' 
    124124  res: '<p>[make_link id:|23| title:||]</p>' 
    125    
     125 
     126link_dash: 
     127  src: '"hello":23#world of fame' 
     128  res: "<p>[make_link dash:|world| id:|23| title:|hello|] of fame</p>" 
     129 
     130link_dash_same_as_title: 
     131  src: '"hello":23# I love you' 
     132  res: "<p>[make_link dash:|hello| id:|23| title:|hello|] I love you</p>" 
     133 
    126134wiki_link: 
    127135  src: "why use ?ruby? ?" 
  • trunk/test/helpers/basic.yml

    r599 r605  
    100100  tem: "<%= node_link(:node=>@node, :text=>@node.ref_lang) %>" 
    101101  res: "<a href='/oo/projects/cleanWater/page22.html'>en</a>" 
    102  
     102   
    103103link_tattr: 
    104104  src: "<r:link tattr='ref_lang'/>" 
     
    139139  res: "<a href='#node22'>status title</a>" 
    140140 
     141link_dash_name: 
     142  src: "<r:link dash='[name]'/>" 
     143  res: "<a href='#status'>status title</a>" 
     144 
     145link_dash_in: 
     146  src: "<r:link dash='true' in='project' mode='tree'/>" 
     147  res: "<a href='...._tree.html#node44'>status title</a>" 
     148 
     149link_dash_name_in: 
     150  src: "<r:link dash='[name]' in='parent'/>" 
     151  res: "<a href='...#status'>status title</a>" 
     152 
    141153anchor: 
    142   src: "<r:anchor/>
    143   res: "<a name='node22'></a>
     154  src: "<r:anchor/> <p do='[id]' anchor='[name]'>hello</p>
     155  res: "<a name='node22'></a> <p><a name='status'></a>33</p>
    144156 
    145157show_title_anchor: