mirror of
https://github.com/there4/markdown-resume.git
synced 2024-12-03 08:59:35 -05:00
Update to use sunra/php-simple-html-dom-parser
Remove the simple-html-dom parser that relies on an outdated repo. This appears to be the most popular repo for the dom library.
This commit is contained in:
@@ -11,6 +11,7 @@ use Assetic\Asset\FileAsset;
|
||||
use Assetic\Filter;
|
||||
use Michelf\MarkdownExtra;
|
||||
use Michelf\SmartyPants;
|
||||
use Sunra\PhpSimple\HtmlDomParser;
|
||||
|
||||
class HtmlCommand extends Command
|
||||
{
|
||||
@@ -113,8 +114,7 @@ class HtmlCommand extends Command
|
||||
$resumeHtml = SmartyPants::defaultTransform($resumeHtml);
|
||||
|
||||
// Construct the title for the html document from the h1 and h2 tags
|
||||
$simpleDom = new \simple_html_dom();
|
||||
$simpleDom->load($resumeHtml);
|
||||
$simpleDom = HtmlDomParser::str_get_html($resumeHtml);
|
||||
$title = sprintf(
|
||||
'%s | %s',
|
||||
$simpleDom->find('h1', 0)->innertext,
|
||||
|
||||
@@ -6,6 +6,7 @@ use Symfony\Component\Console\Input\InputOption;
|
||||
use Symfony\Component\Console\Input\InputArgument;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
use Sunra\PhpSimple\HtmlDomParser;
|
||||
|
||||
class PdfCommand extends HtmlCommand
|
||||
{
|
||||
@@ -59,7 +60,7 @@ class PdfCommand extends HtmlCommand
|
||||
|
||||
// The pdf needs some extra css rules, and so we'll add them here
|
||||
// to our html document
|
||||
$simpleDom = new \simple_html_dom($rendered);
|
||||
$simpleDom = HtmlDomParser::str_get_html($rendered);
|
||||
$body = $simpleDom->find('body', 0);
|
||||
$body->class = $body->class . ' pdf';
|
||||
$rendered = (string) $simpleDom;
|
||||
|
||||
Reference in New Issue
Block a user