mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
BUG Temp disable shortcode SPLIT behaviour due to crash (#6436)
Fixes #5987
This commit is contained in:
parent
c794c29ddb
commit
f314b86ad8
@ -584,7 +584,8 @@ class ShortcodeParser extends Object {
|
|||||||
|
|
||||||
$location = self::INLINE;
|
$location = self::INLINE;
|
||||||
if($class == 'left' || $class == 'right') $location = self::BEFORE;
|
if($class == 'left' || $class == 'right') $location = self::BEFORE;
|
||||||
if($class == 'center' || $class == 'leftAlone') $location = self::SPLIT;
|
// Note: center / leftAlone should be `self::SPLIT`, but this crashes so we fall back to self::INLINE
|
||||||
|
// if($class == 'center' || $class == 'leftAlone') $location = self::SPLIT;
|
||||||
|
|
||||||
if(!$parent) {
|
if(!$parent) {
|
||||||
if($location !== self::INLINE) {
|
if($location !== self::INLINE) {
|
||||||
|
@ -185,7 +185,8 @@ class ShortcodeParserTest extends SapphireTest {
|
|||||||
$this->assertEquals(preg_replace('/\s+/', '', $a), preg_replace('/\s+/', '', $b), $message);
|
$this->assertEquals(preg_replace('/\s+/', '', $a), preg_replace('/\s+/', '', $b), $message);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function testtExtract() {
|
public function testtExtractBefore()
|
||||||
|
{
|
||||||
// Left extracts to before the current block
|
// Left extracts to before the current block
|
||||||
$this->assertEqualsIgnoringWhitespace(
|
$this->assertEqualsIgnoringWhitespace(
|
||||||
'Code<div>FooBar</div>',
|
'Code<div>FooBar</div>',
|
||||||
@ -197,6 +198,13 @@ class ShortcodeParserTest extends SapphireTest {
|
|||||||
'Code<div>Foo<b>BarBaz</b>Qux</div>',
|
'Code<div>Foo<b>BarBaz</b>Qux</div>',
|
||||||
$this->parser->parse('<div>Foo<b>Bar[test_shortcode class=left]Code[/test_shortcode]Baz</b>Qux</div>')
|
$this->parser->parse('<div>Foo<b>Bar[test_shortcode class=left]Code[/test_shortcode]Baz</b>Qux</div>')
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testExtractSplit()
|
||||||
|
{
|
||||||
|
$this->markTestSkipped(
|
||||||
|
'Feature disabled due to https://github.com/silverstripe/silverstripe-framework/issues/5987'
|
||||||
|
);
|
||||||
|
|
||||||
// Center splits the current block
|
// Center splits the current block
|
||||||
$this->assertEqualsIgnoringWhitespace(
|
$this->assertEqualsIgnoringWhitespace(
|
||||||
@ -209,7 +217,9 @@ class ShortcodeParserTest extends SapphireTest {
|
|||||||
'<div>Foo<b>Bar</b></div>Code<div><b>Baz</b>Qux</div>',
|
'<div>Foo<b>Bar</b></div>Code<div><b>Baz</b>Qux</div>',
|
||||||
$this->parser->parse('<div>Foo<b>Bar[test_shortcode class=center]Code[/test_shortcode]Baz</b>Qux</div>')
|
$this->parser->parse('<div>Foo<b>Bar[test_shortcode class=center]Code[/test_shortcode]Baz</b>Qux</div>')
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function testExtractNone() {
|
||||||
// No class means don't extract
|
// No class means don't extract
|
||||||
$this->assertEqualsIgnoringWhitespace(
|
$this->assertEqualsIgnoringWhitespace(
|
||||||
'<div>FooCodeBar</div>',
|
'<div>FooCodeBar</div>',
|
||||||
|
Loading…
Reference in New Issue
Block a user