install smarty via composer and update other php libs
This commit is contained in:
@@ -2,10 +2,25 @@
|
||||
|
||||
namespace League\HTMLToMarkdown\Converter;
|
||||
|
||||
use League\HTMLToMarkdown\Configuration;
|
||||
use League\HTMLToMarkdown\ConfigurationAwareInterface;
|
||||
use League\HTMLToMarkdown\ElementInterface;
|
||||
|
||||
class ListItemConverter implements ConverterInterface
|
||||
class ListItemConverter implements ConverterInterface, ConfigurationAwareInterface
|
||||
{
|
||||
/**
|
||||
* @var Configuration
|
||||
*/
|
||||
protected $config;
|
||||
|
||||
/**
|
||||
* @param Configuration $config
|
||||
*/
|
||||
public function setConfig(Configuration $config)
|
||||
{
|
||||
$this->config = $config;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param ElementInterface $element
|
||||
*
|
||||
@@ -29,10 +44,15 @@ class ListItemConverter implements ConverterInterface
|
||||
}
|
||||
|
||||
if ($list_type === 'ul') {
|
||||
return $prefix . '- ' . $value . "\n";
|
||||
$list_item_style = $this->config->getOption('list_item_style', '-');
|
||||
return $prefix . $list_item_style . ' ' . $value . "\n";
|
||||
}
|
||||
|
||||
$number = $element->getSiblingPosition();
|
||||
if ($list_type === 'ol' && $start = $element->getParent()->getAttribute('start')) {
|
||||
$number = $start + $element->getSiblingPosition() - 1;
|
||||
} else {
|
||||
$number = $element->getSiblingPosition();
|
||||
}
|
||||
|
||||
return $prefix . $number . '. ' . $value . "\n";
|
||||
}
|
||||
|
||||
@@ -109,7 +109,8 @@ class ParagraphConverter implements ConverterInterface
|
||||
{
|
||||
$regExs = array(
|
||||
// Match numbers ending on ')' or '.' that are at the beginning of the line.
|
||||
'/^[0-9]+(?=\)|\.)/'
|
||||
// They will be escaped if immediately followed by a space or newline.
|
||||
'/^[0-9]+(?=(\)|\.)( |$))/'
|
||||
);
|
||||
|
||||
foreach ($regExs as $i) {
|
||||
|
||||
@@ -38,7 +38,8 @@ class HtmlConverter
|
||||
'bold_style' => '**', // Set to '__' if you prefer the underlined style
|
||||
'italic_style' => '_', // Set to '*' if you prefer the asterisk style
|
||||
'remove_nodes' => '', // space-separated list of dom nodes that should be removed. example: 'meta style script'
|
||||
'hard_break' => false,// Set to true to turn <br> into `\n` instead of ` \n`
|
||||
'hard_break' => false, // Set to true to turn <br> into `\n` instead of ` \n`
|
||||
'list_item_style' => '-', // Set the default character for each <li> in a <ul>. Can be '-', '*', or '+'
|
||||
);
|
||||
|
||||
$this->environment = Environment::createDefaultEnvironment($defaults);
|
||||
|
||||
Reference in New Issue
Block a user