1
0
mirror of https://github.com/typemill/typemill.git synced 2025-07-31 03:10:19 +02:00

Version 1.4.0: Fix Markdown and custom fields

This commit is contained in:
trendschau
2020-10-31 07:47:40 +01:00
parent c9a59b84c1
commit 0ef48e831a
2 changed files with 36 additions and 22 deletions

View File

@@ -775,8 +775,15 @@ class ParsedownExtension extends \ParsedownExtra
if (isset($CurrentBlock['continuable']))
{
$methodName = 'block' . $CurrentBlock['type'] . 'Continue';
/* fix definition list */
if($CurrentBlock['type'] == 'DefinitionList' && isset($CurrentBlock['interrupted']))
{
$mdCurrentBlock = $mdCurrentBlock . "\n\n";
}
$Block = $this->$methodName($Line, $CurrentBlock);
# if this line still belongs to the current multiline block
if (isset($Block))
{
@@ -795,7 +802,7 @@ class ParsedownExtension extends \ParsedownExtra
/*new*/ $mdCurrentBlock = $mdCurrentBlock;
}
}
}
}
# ~
@@ -815,11 +822,19 @@ class ParsedownExtension extends \ParsedownExtra
#
# ~
foreach ($blockTypes as $blockType)
{
$Block = $this->{"block$blockType"}($Line, $CurrentBlock);
/*new*/ $mdBlock = $line;
/* new */ $mdBlock = $line;
/* dirty fix for tables and definition lists, not sure why this happens */
if ( ($blockType == "Table" OR $blockType == "DefinitionList") && isset($mdCurrentBlock) )
{
$mdBlock = $mdCurrentBlock . "\n" . $line;
}
/* fix end */
if (isset($Block))
{
$Block['type'] = $blockType;
@@ -841,6 +856,7 @@ class ParsedownExtension extends \ParsedownExtra
$CurrentBlock = $Block;
/*new*/ $mdCurrentBlock = $mdBlock;
continue 2;
}
}
@@ -885,14 +901,17 @@ class ParsedownExtension extends \ParsedownExtra
# ~
if (isset($CurrentBlock))
{
{
$Elements[] = $this->extractElement($CurrentBlock);
/*new*/ $mdElements[] = $mdCurrentBlock;
}
# ~
/* echo '<pre>';
print_r($mdElements);
die();
/*new*/ return $mdElements;
# return $Elements;
# return $Elements;
}