Example #1
0
 /**
  * @dataProvider modifyHrefProvider
  */
 public function testModifyInternalLink($href, $expected_href)
 {
     $linker = new Linker(new Search($this->test_options));
     $dom = new \DOMDocument('1.0', 'UTF-8');
     $a = $dom->createElement('a', 'Unit-Test');
     $a->setAttribute('href', $href);
     $linker->modifyInternalLink($a);
     $this->assertEquals($expected_href, $a->getAttribute('href'));
 }
Example #2
0
 private function modifyInternalLinks()
 {
     if (!is_null($this->_parsed_markdown)) {
         $linker = new Linker($this->_tree->getSearch());
         foreach ($linker->getInternalLinks($this->_parsed_markdown) as $internal_link) {
             $linker->modifyInternalLink($internal_link);
         }
     }
 }