Ejemplo n.º 1
0
 /**
  * Create a new instance and enable or disable features.
  * @param array $features   enabled or disabled features
  *
  * You can pass an array of features to disable some of them for performance improvement.
  * E.g.
  * $features = array(
  *     'table' => false,
  *     'definition_list' => false
  * )
  */
 public function __construct(array $features = array())
 {
     parent::__construct();
     $this->features = array_merge($this->features, $features);
     if (!$this->features['header']) {
         unset($this->block_gamut['doHeaders']);
     }
     if (!$this->features['list']) {
         unset($this->block_gamut['doLists']);
     }
     if (!$this->features['horizontal_rule']) {
         unset($this->block_gamut['doHorizontalRules']);
     }
     if (!$this->features['table']) {
         unset($this->block_gamut['doTables']);
     }
     if (!$this->features['foot_note']) {
         unset($this->document_gamut['stripFootnotes']);
         unset($this->document_gamut['appendFootnotes']);
         unset($this->span_gamut['doFootnotes']);
     }
     if (!$this->features['fenced_code_block']) {
         unset($this->document_gamut['doFencedCodeBlocks']);
         unset($this->block_gamut['doFencedCodeBlocks']);
     }
     if (!$this->features['abbreviation']) {
         unset($this->document_gamut['stripAbbreviations']);
         unset($this->span_gamut['doAbbreviations']);
     }
     if (!$this->features['definition_list']) {
         unset($this->block_gamut['doDefLists']);
     }
     if (!$this->features['reference_link']) {
         unset($this->document_gamut['stripLinkDefinitions']);
     }
     if (!$this->features['block_quote']) {
         unset($this->block_gamut['doBlockQuotes']);
     }
     if (!$this->features['code_block']) {
         unset($this->block_gamut['doCodeBlocks']);
     }
     if (!$this->features['auto_link']) {
         unset($this->span_gamut['doAutoLinks']);
     }
     if (!$this->features['entities'] && !$this->features['no_html']) {
         $this->no_entities = true;
     }
 }
 /**
  * Constructor
  *
  * @param array $configuration
  * @return void
  */
 public function __construct(array $configuration = null)
 {
     $this->block_gamut += array("doFencedFigures" => 7);
     parent::__construct($configuration);
 }
Ejemplo n.º 3
0
 public function __construct(array $configure = null)
 {
     $this->block_gamut += array("parserUser" => 100, 'parserUrl' => 10000);
     $this->span_gamut += array('parserNewLine' => 0);
     parent::__construct($configure);
 }