You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
26 lines
495 B
26 lines
495 B
<?php
|
|
|
|
namespace App\Parser\DocxParser;
|
|
|
|
class Link
|
|
{
|
|
|
|
public function handle($element)
|
|
{
|
|
$text = $element->getText();
|
|
//if (! is_string($text)) {
|
|
// dd($element);
|
|
//}
|
|
|
|
return [
|
|
'content' => $this->buildHtmlLink($element, $text),
|
|
'type' => 'link'
|
|
];
|
|
}
|
|
|
|
|
|
private function buildHtmlLink($element, $text)
|
|
{
|
|
return "<a href='".$element->getLinkSrc()."' target='_blank'>".$text."</a>";
|
|
}
|
|
}
|