Skip to content
Snippets Groups Projects
Commit 9269d0b1 authored by Michael Hamann's avatar Michael Hamann
Browse files

Fix the media usage index to include local links

parent 93d16b87
No related branches found
No related tags found
No related merge requests found
......@@ -26,6 +26,13 @@ class fultext_mediause_test extends DokuWikiTest {
$this->assertEquals(array('test:medialinks'), ft_mediause('test:example.png'));
}
public function test_media_in_local_links() {
saveWikiText('test:locallinks', '[[#test|{{wiki:logolocal.png}}]]', 'Test init');
idx_addPage('test:locallinks');
$this->assertEquals(array('test:locallinks'), ft_mediause('wiki:logolocal.png'));
}
public function test_media_in_footnotes() {
saveWikiText('test:media_footnotes', '(({{footnote.png?20x50}} [[foonote|{{:footlink.png}}]]))', 'Test initialization');
idx_addPage('test:media_footnotes');
......
......@@ -274,7 +274,12 @@ class Doku_Renderer_metadata extends Doku_Renderer {
$this->internallink($link, $link);
}
function locallink($hash, $name = null){}
function locallink($hash, $name = null){
if(is_array($name)) {
$this->_firstimage($name['src']);
if ($name['type'] == 'internalmedia') $this->_recordMediaUsage($name['src']);
}
}
/**
* keep track of internal links in $this->meta['relation']['references']
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment