/[drupal]/contributions/modules/freelinking/freelinking.module
ViewVC logotype

Diff of /contributions/modules/freelinking/freelinking.module

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.32.2.11.2.2.2.17, Tue Nov 10 00:36:12 2009 UTC revision 1.32.2.11.2.2.2.18, Thu Nov 12 08:03:14 2009 UTC
# Line 57  return TRUE; Line 57  return TRUE;
57          $match[0] = preg_replace('/^[^\\\\]/', '', $match[0]);          $match[0] = preg_replace('/^[^\\\\]/', '', $match[0]);
58    
59          // in markdown mode, the first match is part of the target.          // in markdown mode, the first match is part of the target.
60            // This is hacky and temporary while matching is in transition.
61          if ($syntax == 'markdown') {          if ($syntax == 'markdown') {
62            $match[1] .= '|' . $match[2];            if (!$match[4]) { $match[4] = $match[3]; }
63              else { $match[4] = $match[3] . ':' . $match[4]; }
64              // encode pipes in Title.
65              $match[2] = urlencode($match[2]);
66              $match[1] = $match[4] . '|' . $match[2] . '|' . $match[5];
67          }          }
68    
69          // default freelink (no colon)          // default freelink (no colon)
# Line 179  function freelinking_freelink_alter(&$li Line 184  function freelinking_freelink_alter(&$li
184      $link['error'] = t('Invalid Link');      $link['error'] = t('Invalid Link');
185      return;      return;
186    }    }
   
187    // title text is empty, insert from target or use URL    // title text is empty, insert from target or use URL
188    if (!$link[0]) {    if (!$link[0]) {
189      $link[0] = $target['text'] ? $target['text'] : $link[1];      $link[0] = $target['text'] ? $target['text'] : $link[1];
# Line 334  function freelinking_parse_target($targe Line 338  function freelinking_parse_target($targe
338    $args = array();    $args = array();
339    $args['target'] = $target;    $args['target'] = $target;
340    list($args['dest'], $args['text'], $args['tooltip'], $other) = explode('|', $target);    list($args['dest'], $args['text'], $args['tooltip'], $other) = explode('|', $target);
341      $args['text'] = urldecode($args['text']);
342    return $args;    return $args;
343  }  }
344    
# Line 348  function freelinking_internal_tooltip($t Line 353  function freelinking_internal_tooltip($t
353          $metatags = nodewords_get('node', $id);          $metatags = nodewords_get('node', $id);
354          $description = $metatags['description'];          $description = $metatags['description'];
355        }        }
       if (empty($description)) {  
         $n = node_load($id);  
         $description = $n->teaser;  
       }  
356        break;        break;
357    }    }
358      $description = str_replace('"', '\'', $description);
359    return truncate_utf8($description, 200, FALSE, TRUE);    return truncate_utf8($description, 200, FALSE, TRUE);
360  }  }
361    
# Line 419  function _freelinking_match_pattern($sep Line 421  function _freelinking_match_pattern($sep
421    $option['single_bracket'] =    $option['single_bracket'] =
422      '/[^\\\\]\[(.+' . $separator . '?.+)]/Uu';      '/[^\\\\]\[(.+' . $separator . '?.+)]/Uu';
423    $option['markdown'] =    $option['markdown'] =
424      '/[^\\\\]\[([^\[.]*)\]\((.+' . $separator . '.+)\)/Uu';      '/[^\\\\](\[([^\]]+)\]\((.+)(?:' . $separator . '(.+))?(?:\s"(.+)")?\))/Uu';
   
425    return $option;    return $option;
426  }  }
427    

Legend:
Removed from v.1.32.2.11.2.2.2.17  
changed lines
  Added in v.1.32.2.11.2.2.2.18

  ViewVC Help
Powered by ViewVC 1.1.2