Closed xuannghia closed 5 years ago
Hi @xuannghia, can you post the code to reproduce the issues reported above?
Hi @thunderer This is my example code
<?php
require_once 'vendor/autoload.php';
use Thunder\Shortcode\HandlerContainer\HandlerContainer;
use Thunder\Shortcode\Parser\RegularParser;
use Thunder\Shortcode\Processor\Processor;
use Thunder\Shortcode\Shortcode\ShortcodeInterface;
use Thunder\Shortcode\Syntax\Syntax;
function shortcode($text) {
$handlers = new HandlerContainer();
$handlers->add('container', function(ShortcodeInterface $s) {
return '<div class="container">'.$s->getContent().'</div>';
});
$defaultSyntax = new Syntax('[', ']', '/', '=', '"');
$processor = new Processor(new RegularParser($defaultSyntax), $handlers);
return $processor->process($text);
}
$case_1 = '[container][Tiêu đề][/container]';
$case_2 = '[container][][/container]';
echo shortcode($case_1); // I get <div class="container"></div>[Tiêu đề][/container]
echo shortcode($case_2); // I get <div class="container"></div>[][/container]
P/s: I use PHP 7.3 and thunderer/shortcode version 0.6.5 (I install with composer)
Thank you.
Oh, sorry for my mistake. These issues have been resolved in version 0.7.2. But file README.md instructing me for installing version 0.6.5. Can you change it so that those who come later do not have to meet the situation like me?
@xuannghia are both issues resolved by upgrading to v0.7
? I will update the README shortly.
@xuannghia can you confirm that the upgrade you mentioned above resolved both problems? If so, can we close this issue?
@thunderer Yes, upgrading to v0.7.2 can fix both issues. Sorry for the late reply.
Hello, Thank you because this library. But I have some issues with some content below:
In this case I want to show
<div class="container">[Tiêu đề]</div>
("Tiêu đề" is "Title" in English) but the container shortcode auto close and I get<div class="container"></div>[Tiêu đề][/container]
But this content will working if it is not contain Vietnamese characters:
In this case I want to show
<div class="container">[]</div>
but the container shortcode auto close and I get<div class="container"></div>[][/container]
. Similar to issue one.Can you help me fix these issues?
Thank you.