diff --git linkit.js linkit.js index 5490205..5700aa6 100644 --- linkit.js +++ linkit.js @@ -46,7 +46,7 @@ linkit_helper = { * See if the link contains a #anchor */ seek_for_anchor : function(href) { - var matches = href.match(/internal:.*(#.*)/i); + var matches = href.match(/.*(#.*)/i); anchor = (matches == null) ? '' : matches[1].substring(1); return anchor; } diff --git plugins/linkit_node/linkit_node.module plugins/linkit_node/linkit_node.module index 3601f90..25e8319 100644 --- plugins/linkit_node/linkit_node.module +++ plugins/linkit_node/linkit_node.module @@ -59,7 +59,7 @@ function linkit_node_linkit_load_plugins($string) { foreach ($result AS $node) { $matches['node'][$i] = array( 'title' => $node->title, - 'path' => 'internal:node/' . $node->nid, + 'path' => 'node/' . $node->nid, 'information' => array( 'type' => 'Node', ), @@ -106,12 +106,9 @@ function linkit_node_linkit_load_plugins($string) { * Implements hook_linkit_get_search_styled_link(). */ function linkit_node_linkit_get_search_styled_link($string) { - // Node links created with Linkit will always begin with "internal:" - if (strpos($string, 'internal:') === FALSE) { - return; - } // Check to see that the link really is a node link + // Backwards compatible with internal: links $splitted_string = explode('/', str_replace('internal:', '', $string)); if ($splitted_string[0] != 'node') { return; @@ -129,7 +126,7 @@ function linkit_node_linkit_get_search_styled_link($string) { if (!$result) { return; } - return check_plain($result->title) . ' [path:internal:node/' . $result->nid . ']'; + return check_plain($result->title) . ' [path:node/' . $result->nid . ']'; } /**