]> git.wincent.com - wikitext.git/commitdiff
Add ability to override external_link_rel at parse time
authorWincent Colaiuta <win@wincent.com>
Sun, 17 Oct 2010 14:42:10 +0000 (16:42 +0200)
committerWincent Colaiuta <win@wincent.com>
Sun, 17 Oct 2010 14:42:10 +0000 (16:42 +0200)
Signed-off-by: Wincent Colaiuta <win@wincent.com>
ext/parser.c

index 742db02c473c3736574e0df190546e39d845ac42..57b4014fc55658a6a05a6266d75c4d7ebc035654 100644 (file)
@@ -1116,6 +1116,14 @@ VALUE Wikitext_parser_parse(int argc, VALUE *argv, VALUE self)
         if (rb_funcall(options, has_key, 1, id) == Qtrue)
             base_heading_level = NUM2INT(rb_hash_aref(options, id));
 
         if (rb_funcall(options, has_key, 1, id) == Qtrue)
             base_heading_level = NUM2INT(rb_hash_aref(options, id));
 
+        // :external_link_rel => 'nofollow'
+        id = ID2SYM(rb_intern("external_link_rel"));
+        if (rb_funcall(options, has_key, 1, id) == Qtrue)
+        {
+            link_rel = rb_hash_aref(options, id);
+            link_rel = NIL_P(link_rel) ? Qnil : StringValue(link_rel);
+        }
+
         // :output_style => :html/:xml
         id = ID2SYM(rb_intern("output_style"));
         if (rb_funcall(options, has_key, 1, id) == Qtrue)
         // :output_style => :html/:xml
         id = ID2SYM(rb_intern("output_style"));
         if (rb_funcall(options, has_key, 1, id) == Qtrue)