<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -3,11 +3,27 @@ CHANGESET1:
   to:   '0.14.1'
 
   CHANGES:
-    basic:
-      if_or: &quot;&lt;r:if can='write' or_test='[d_foo]'&gt;hello&lt;/r:if&gt;&quot;
-      if_or: &quot;&lt;r:if can='write' or_test='d_foo'&gt;hello&lt;/r:if&gt;&quot;
+    if_or:
+      old: &quot;&lt;r:if can='write' or_test='[d_foo]'&gt;hello&lt;/r:if&gt;&quot;
+      new: &quot;&lt;r:if can='write' or_test='d_foo'&gt;hello&lt;/r:if&gt;&quot;
 
 SHOULD_CHANGE:
   basic:
-    link_sharp_name: &quot;&lt;r:link sharp='[name]'/&gt;&quot;
-    link_sharp_name: &quot;&lt;r:link sharp='#{name}'/&gt;&quot;
\ No newline at end of file
+    link_anchor_name:
+      old: &quot;&lt;r:link anchor='[name]'/&gt;&quot;
+      new: &quot;&lt;r:link anchor='#{name}'/&gt;&quot;
+
+CHANGESET2:
+  from: '0.15.1'
+  to:   '0.15.2'
+
+  CHANGES:
+    basic:
+      link_sharp:
+        old: &quot;&lt;r:link sharp='true'/&gt;&quot;
+        new: &quot;&lt;r:link anchor='true'/&gt;&quot;
+      anchor_with_link:
+        old: &quot;&lt;r:link anchor='true'/&gt;&quot;
+        new: &quot;&lt;r:anchor do='link'/&gt;&quot;
+
+</diff>
      <filename>doc/zafu_changes.yml</filename>
    </modified>
    <modified>
      <diff>@@ -18,6 +18,9 @@ module Zafu
               end
             end
             res[key.to_sym] = value
+          elsif tag_type == :link &amp;&amp; k == :_name
+            # :_name set by r_anchor
+            res[:name] ||= v
           elsif tag_type == :link &amp;&amp; ![:style, :class, :id, :title].include?(k)
             # bad html parameter for links (some keys for link tags are used as query parameters)
             # filter out
@@ -26,10 +29,10 @@ module Zafu
           end
         end
 
-        if params[:anchor]
-          @anchor_param = nil
-          res[:name] = anchor_name(params[:anchor], node)
-        end
+        #if params[:anchor]
+        #  @anchor_param = nil
+        #  res[:name] = anchor_name(params[:anchor], node)
+        #end
 
         res
       end</diff>
      <filename>lib/zafu/core/html.rb</filename>
    </modified>
    <modified>
      <diff>@@ -14,7 +14,9 @@ module Zafu
         if key = @params[:store_date]
           set_stored(Date, key, current_date)
         end
-        @anchor_param = @params[:anchor]
+        if @method != 'link'
+          @anchor_param = @params[:anchor]
+        end
 
         true
       end
@@ -23,11 +25,10 @@ module Zafu
       def after_render(text)
         if @anchor_param
           @params[:anchor] = @anchor_param # set back in case of double rendering so it is computed again
-          res = r_anchor + super
+          r_anchor + super
         else
-          res = super
+          super
         end
-        res
       end
 
       # Our special version of r_expand_with tag with &quot;set_&quot; parsing.</diff>
      <filename>lib/zafu/core/move_to_parser.rb</filename>
    </modified>
    <modified>
      <diff>@@ -64,15 +64,15 @@ module Zafu
           opts[:mode] = mode.inspect
         end
 
-        if sharp = params.delete(:sharp)
-          opts[:sharp] = sharp.inspect
+        if anchor = params.delete(:anchor)
+          opts[:anchor] = anchor.inspect
         end
 
-        if sharp_in = params.delete(:in)
-          finder, klass = build_finder_for(:first, sharp_in, {})
+        if anchor_in = params.delete(:in)
+          finder, klass = build_finder_for(:first, anchor_in, {})
           return unless finder
           return parser_error(&quot;invalid class (#{klass})&quot;) unless klass.ancestors.include?(Node)
-          opts[:sharp_in] = finder
+          opts[:anchor_in] = finder
         end
 
         if @html_tag &amp;&amp; @html_tag != 'a'
@@ -87,7 +87,7 @@ module Zafu
         end
 
         (params.keys - [:style, :class, :id, :rel, :name, :anchor, :attr, :tattr, :trans, :text]).each do |k|
-          next if k.to_s =~ /if_|set_/
+          next if k.to_s =~ /if_|set_|\A_/
           query_params[k] = params[k]
         end
 
@@ -207,7 +207,13 @@ module Zafu
       end
 
       def r_anchor(obj=node)
-        &quot;&lt;a name='#{anchor_name(@anchor_param, obj)}'&gt;&lt;/a&gt;&quot;
+        if single_child_method == 'link'
+          link = @blocks[0]
+          link.params.merge!(:_name =&gt; anchor_name(params[:type] || 'true', obj))
+          expand_block(link)
+        else
+          &quot;&lt;a name='#{anchor_name(@anchor_param, obj)}'&gt;&lt;/a&gt;&quot;
+        end
       end
 
       def r_check_lang
@@ -226,7 +232,7 @@ module Zafu
           &quot;#{base_class.to_s.underscore}#{erb_node_id(obj)}&quot;
         end
       end
-      
+
       def link_to_update(target, opts = {})
         method = opts[:method] || :get
 </diff>
      <filename>lib/zafu/support/links.rb</filename>
    </modified>
    <modified>
      <diff>@@ -187,10 +187,10 @@ module Zena
             # link inside the cms &quot;&quot;:34
             title, id = $1, $2
             if id =~ /(.*?)#(.*)/
-              id, sharp = $1, $2
-              sharp = 'true' if sharp == ''
+              id, anchor = $1, $2
+              anchor = 'true' if anchor == ''
             end
-            store @helper.make_link(:title=&gt;title,:id=&gt;id,:sharp=&gt;sharp)
+            store @helper.make_link(:title=&gt;title,:id=&gt;id,:anchor=&gt;anchor)
           end
         elsif @text =~ /\A&quot;([^&quot;]*)&quot;:(#{PSEUDO_ID_REGEXP})((_[a-z]+|)(\.[a-z]+|)(#[a-z_\/\[\]]*|))/m
           #puts &quot;SHORTCUT_LINK:[#{$&amp;}]&quot;
@@ -209,10 +209,10 @@ module Zena
                 title = &quot;#{node.fullpath}#{mode_format}&quot;
               end
               if id =~ /(.*?)#(.*)/
-                id, sharp = $1, $2
-                sharp = 'true' if sharp == ''
+                id, anchor = $1, $2
+                anchor = 'true' if anchor == ''
               end
-              store @helper.make_link(:title=&gt;title,:id=&gt;id,:sharp=&gt;sharp,:node=&gt;node)
+              store @helper.make_link(:title=&gt;title,:id=&gt;id,:anchor=&gt;anchor,:node=&gt;node)
             end
           elsif @translate_ids
             store $&amp;</diff>
      <filename>lib/zena/parser/zazen_rules.rb</filename>
    </modified>
    <modified>
      <diff>@@ -17,20 +17,22 @@ module Zena
 
           return '#' unless node
 
-
-          if sharp = options.delete(:sharp)
-            if sharp =~ /\[(.+)\]/
-              sharp_value = node.safe_read($1)
-            elsif sharp == 'true'
-              sharp_value = &quot;node#{node[:zip]}&quot;
+          if anchor = options.delete(:anchor)
+            if anchor =~ /\[(.+)\]/
+              anchor_value = node.safe_read($1)
+            elsif anchor == 'true'
+              anchor_value = &quot;node#{node[:zip]}&quot;
             else
-              sharp_value = sharp
+              fixed = true
+              anchor_value = anchor
             end
-            if sharp_in = options.delete(:sharp_in)
-              sharp_node = sharp_in.kind_of?(Node) ? sharp_in : (node.find(:first, [sharp_in]) || node)
-              return &quot;#{zen_path(sharp_node, options)}##{sharp_value}&quot;
+            if anchor_in = options.delete(:anchor_in)
+              anchor_node = anchor_in.kind_of?(Node) ? anchor_in : (node.find(:first, [anchor_in]) || node)
+              return &quot;#{zen_path(anchor_node, options)}##{anchor_value}&quot;
+            elsif fixed
+              return &quot;#{zen_path(node, options)}##{anchor_value}&quot;
             else
-              return &quot;##{sharp_value}&quot;
+              return &quot;##{anchor_value}&quot;
             end
           end
 </diff>
      <filename>lib/zena/use/urls.rb</filename>
    </modified>
    <modified>
      <diff>@@ -77,16 +77,16 @@ module Zena
         def make_link(opts)
           # for latex refs, see http://www.tug.org/applications/hyperref/manual.html
           link_opts = {}
-          if sharp = opts[:sharp]
-            if sharp =~ /\[(.+?)\/(.*)\]/
-              sharp_in, sharp = $1, $2
-              sharp = sharp == '' ? 'true' : &quot;[#{sharp}]&quot;
-              link_opts[:sharp_in] = sharp_in
+          if anchor = opts[:anchor]
+            if anchor =~ /\[(.+?)\/(.*)\]/
+              anchor_in, anchor = $1, $2
+              anchor = anchor == '' ? 'true' : &quot;[#{anchor}]&quot;
+              link_opts[:anchor_in] = anchor_in
             end
-            if ['[id]', '[zip]'].include?(sharp)
-              link_opts[:sharp] = 'true'
+            if ['[id]', '[zip]'].include?(anchor)
+              link_opts[:anchor] = 'true'
             else
-              link_opts[:sharp] = sharp
+              link_opts[:anchor] = anchor
             end
           end
           if opts[:id] =~ /(\d+)(_\w+|)(\.\w+|)/</diff>
      <filename>lib/zena/use/zazen.rb</filename>
    </modified>
    <modified>
      <diff>@@ -157,13 +157,13 @@ link_no_title:
   src: '&quot;&quot;:23'
   res: '&lt;p&gt;[make_link id:|23| title:||]&lt;/p&gt;'
 
-link_sharp:
+link_anchor:
   src: '&quot;hello&quot;:23#world of fame'
-  res: &quot;&lt;p&gt;[make_link id:|23| sharp:|world| title:|hello|] of fame&lt;/p&gt;&quot;
+  res: &quot;&lt;p&gt;[make_link anchor:|world| id:|23| title:|hello|] of fame&lt;/p&gt;&quot;
 
-link_sharp_same_as_title:
+link_anchor_same_as_title:
   src: '&quot;hello&quot;:23# I love you'
-  res: &quot;&lt;p&gt;[make_link id:|23| sharp:|true| title:|hello|] I love you&lt;/p&gt;&quot;
+  res: &quot;&lt;p&gt;[make_link anchor:|true| id:|23| title:|hello|] I love you&lt;/p&gt;&quot;
 
 link_with_ending_punct:
   src: &quot;I love \&quot;\&quot;:20.&quot;</diff>
      <filename>test/unit/zena/parser/zazen.yml</filename>
    </modified>
    <modified>
      <diff>@@ -65,6 +65,10 @@ class UrlsTest &lt; Zena::View::TestCase
     assert_equal &quot;/en/image30_pv.jpg?#{node.updated_at.to_i + Iformat['pv'][:hash_id]}&quot;, zen_path(node, :format =&gt; 'jpg', :mode =&gt; 'pv')
   end
 
+  def test_zen_path_with_anchor
+    assert_equal '/en/section12.html#comments', zen_path(nodes(:people), :anchor =&gt; 'comments')
+  end
+
   def test_zen_path_asset
     login(:ant)
     node = secure!(Node) { nodes(:zena) }</diff>
      <filename>test/unit/zena/use/urls_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -260,20 +260,20 @@ link_root:
   tem: &quot;&lt;a href='&lt;%= zen_path((secure(Node) { Node.find(_ID(zena))})) %&gt;'&gt;&lt;%= @node.version.title %&gt;&lt;/a&gt;&quot;
   res: &quot;&lt;a href='/oo'&gt;status title&lt;/a&gt;&quot;
 
-link_sharp:
-  src: &quot;&lt;r:link sharp='true'/&gt;&quot;
+link_anchor:
+  src: &quot;&lt;r:link anchor='true'/&gt;&quot;
   res: &quot;&lt;a href='#node22'&gt;status title&lt;/a&gt;&quot;
 
-link_sharp_name:
-  src: &quot;&lt;r:link sharp='[name]'/&gt;&quot;
+link_anchor_name:
+  src: &quot;&lt;r:link anchor='[name]'/&gt;&quot;
   res: &quot;&lt;a href='#status'&gt;status title&lt;/a&gt;&quot;
 
-link_sharp_in:
-  src: &quot;&lt;r:link sharp='true' in='project' mode='tree'/&gt;&quot;
+link_anchor_in:
+  src: &quot;&lt;r:link anchor='true' in='project' mode='tree'/&gt;&quot;
   res: &quot;&lt;a href='/oo/projects/cleanWater_tree#node22'&gt;status title&lt;/a&gt;&quot;
 
-link_sharp_name_in:
-  src: &quot;&lt;r:link sharp='[name]' in='parent'/&gt;&quot;
+link_anchor_name_in:
+  src: &quot;&lt;r:link anchor='[name]' in='parent'/&gt;&quot;
   res: &quot;&lt;a href='/oo/projects/cleanWater#status'&gt;status title&lt;/a&gt;&quot;
 
 link_stored:
@@ -300,7 +300,7 @@ anchor:
   res: &quot;&lt;a name='node22'&gt;&lt;/a&gt;&lt;a name='status'&gt;&lt;/a&gt; &lt;p&gt;22&lt;/p&gt;&quot;
 
 anchor_in_link:
-  src: &quot;&lt;r:link anchor='true'/&gt;&quot;
+  src: &quot;&lt;r:anchor do='link'/&gt;&quot;
   res: &quot;&lt;a name='node22' href='/oo/projects/cleanWater/page22.html'&gt;status title&lt;/a&gt;&quot;
 
 show_title_anchor:
@@ -320,7 +320,7 @@ link_version:
 version_anchor:
   context:
     node: 'opening'
-  src: &quot;&lt;r:traductions&gt;&lt;r:each join=', '&gt;&lt;r:link tattr='lang' anchor='true'/&gt;&lt;/r:each&gt;&lt;/r:traductions&gt;&quot;
+  src: &quot;&lt;r:traductions&gt;&lt;r:each join=', '&gt;&lt;r:anchor do='link' tattr='lang'/&gt;&lt;/r:each&gt;&lt;/r:traductions&gt;&quot;
   res: &quot;&lt;a name='version27.2' href='/oo/projects/cleanWater/post27.html?lang=en'&gt;english&lt;/a&gt;, &lt;a name='version27.1' href='/oo/projects/cleanWater/post27.html?lang=fr'&gt;french&lt;/a&gt;&quot;
 
 title:</diff>
      <filename>test/unit/zena/zena_tags/basic.yml</filename>
    </modified>
    <modified>
      <diff>@@ -11,19 +11,19 @@ hello:
   tem: &quot;&lt;%= zazen('Hello *World*') %&gt;&quot;
   res: &quot;&lt;p&gt;Hello &lt;strong&gt;World&lt;/strong&gt;&lt;/p&gt;&quot;
 
-link_sharp:
+link_anchor:
   tem: &quot;&lt;%= zazen('see \&quot;\&quot;:22#') %&gt;&quot;
   res: &quot;&lt;p&gt;see &lt;a href=\&quot;#node22\&quot;&gt;status title&lt;/a&gt;&lt;/p&gt;&quot;
 
-link_sharp_attribute:
+link_anchor_attribute:
   tem: &quot;&lt;%= zazen('see \&quot;\&quot;:22#[name]') %&gt;&quot;
   res: &quot;&lt;p&gt;see &lt;a href=\&quot;#status\&quot;&gt;status title&lt;/a&gt;&lt;/p&gt;&quot;
 
-link_sharp_in:
+link_anchor_in:
   tem: &quot;&lt;%= zazen('see \&quot;\&quot;:22#[parent/]') %&gt;&quot;
   res: &quot;&lt;p&gt;see &lt;a href=\&quot;/oo/projects/cleanWater#node22\&quot;&gt;status title&lt;/a&gt;&lt;/p&gt;&quot;
 
-link_sharp_in_name:
+link_anchor_in_name:
   tem: &quot;&lt;%= zazen('see \&quot;\&quot;:22#[parent/name]') %&gt;&quot;
   res: &quot;&lt;p&gt;see &lt;a href=\&quot;/oo/projects/cleanWater#status\&quot;&gt;status title&lt;/a&gt;&lt;/p&gt;&quot;
 </diff>
      <filename>test/unit/zena/zena_tags/zazen.yml</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b5bc6a9f194f41cb87775c0eacd074706535cc94</id>
    </parent>
  </parents>
  <author>
    <name>Gaspard Bucher</name>
    <email>gaspard@teti.ch</email>
  </author>
  <url>http://github.com/zena/zena/commit/bd56bd152be1939f213b6743f50d427150e937f4</url>
  <id>bd56bd152be1939f213b6743f50d427150e937f4</id>
  <committed-date>2009-11-05T08:13:28-08:00</committed-date>
  <authored-date>2009-11-05T08:13:28-08:00</authored-date>
  <message>Changed syntax for anchors in links. See doc/zafu_changes.yml for details.</message>
  <tree>a15d975a3e181a9c3d0a4aac7b506b5276104e49</tree>
  <committer>
    <name>Gaspard Bucher</name>
    <email>gaspard@teti.ch</email>
  </committer>
</commit>
