Closed jenssegers closed 10 years ago
@jenssegers Is it right?
Expected result is
<div class="col-md-6"><p>This is a paragraph</p></div>
but actual
<div class="col-md-6">This is a paragraph</div>
Yes.
I found a "solution". I'm now executing my extension on 'finalize'. It then splits the text into parts again, parses the parts en joins them again (like the paragraphExtension).
Block level HTML will be ignored.
{.col-md-6} This is a paragraph
into <div class=".col-md-6"> This is a paragraph </div>
Then, HtmlBlockExtension turns HTML block into hashes to skip parsing.
{hash:xxxxxxxxxxxxxxxxxxxxxx}
How about this?
//separate text into `{.col-md-6}` and `This is a paragraph`
// Do regexp
$grid = '{.col-md-6}';
$content = new Text('\n\nThis is a paragraph\n\n');
// call block level parser manually
$this->getEmitter()->emit('block', [$content]);
// combine them
return '<div>' . $content . '</div>';
Oh, it's too late :cry:
I wrote a small extension that helps me integrate bootstrap's grid system. But when the extension gets executed, it does not gets parsed as a regular paragraph block anymore. Is there a way to to "chain" extensions so that the parsing does not stop on 1 extension?
For example, if I have something like this:
It will be wrapped with
<div class=".col-md-6">
by my extension, but it will not be transformed to a paragraph.