textile/php-textile

Inconsistent parsing when options enabled?

Closed this issue · 0 comments

Prerequisites

  • Are you running the latest version of PHP-Textile?
  • $ composer update?

Expected behaviour

All parsing should be consistent with inline elements such as bold, regardless of restricted, lite or block elements off.

Given _hello_ *there*? as input, the output should always be <em>hello</em> <strong>there</strong>?

Actual behaviour

When using setRestricted, setLite, setBlockTags(false) and setImages, the output is <em>hello</em> *there*?

Steps to reproduce

>>> $parser = new \Netcarver\Textile\Parser();
=> Netcarver\Textile\Parser {#2999}
>>> $parser->parse('_hello_ *there*?');
=> "<p><em>hello</em> <strong>there</strong>?</p>"
>>> $parser->setBlockTags(false)->parse('_hello_ *there*?');
=> "<em>hello</em> *there*?"
>>> $parser->setRestricted(true)->parse('_hello_ *there*?');
=> "<em>hello</em> *there*?"
>>> $parser->setLite(true)->parse('_hello_ *there*?');
=> "<em>hello</em> *there*?"
>>> $parser->setImages(false)->parse('_hello_ *there*?');
=> "<em>hello</em> *there*?"

Additional information

PHP-Textile version: 3.7.3
PHP version: 7.3.11