-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Undefined index: text #152
Comments
I'm also encountering this issue. |
Hi, Using composer require erusev/parsedown-extra to install, you got the broken 0.8.1 release. |
Bug or not? // $Line
array ( 'body' => '# Some title text', 'indent' => 0, 'text' => '# Some title text', )
// $Block
array ( 'element' => array ( 'name' => 'h1', 'handler' => array ( 'function' => 'lineElements', 'argument' => 'Some title text', 'destination' => 'elements', ), ), ) protected function blockHeader($Line)
{
$Block = parent::blockHeader($Line);
if (! isset($Block)) {
return null;
}
if (preg_match('/[ #]*{('.$this->regexAttribute.'+)}[ ]*$/', $Block['element']['text'], $matches, PREG_OFFSET_CAPTURE))
{
$attributeString = $matches[1][0];
$Block['element']['attributes'] = $this->parseAttributeData($attributeString);
$Block['element']['text'] = substr($Block['element']['text'], 0, $matches[0][1]);
}
return $Block;
} Parsedown: Going back to ParsedownExtra: |
This is a bug, and I've documented it in my own netniV/ParsedownID#1 tracker just now... which i've copied here for completeness: This seems to occur due to a mismatch between parsedown v1.8.0-beta7 and parse-extra v0.8.1. In the latest version of Parsedown, the blockHeader element is returned without the text attribute from the blockHeader function. v1.7.4$Block = array(
'element' => array(
'name' => 'h' . min(6, $level),
'text' => $text,
'handler' => 'line',
),
); v1.8.0-beta7$Block = array(
'element' => array(
'name' => 'h' . min(6, $level),
'handler' => array(
'function' => 'lineElements',
'argument' => $text,
'destination' => 'elements',
)
),
); I foresee that the way to correct this would be to patch parsedown-extra to see if the text element exists and if not, see if the handler is an array, thus use the argument value. Alternatively, release a 0.8.2 version that depends on the beta-7 version with the correct usage. I have also suggested that Parsedown 1.8.0-beta7 be published as a full version now since it's not been updated in almost a year erusev/parsedown#765 (comment) |
At version 0.8.0 Header block had this line:
It was changed to this line in 0.8.1:
Now, with this change, it fails on custom-id with
Undefined index: text
. Is it a regression?The text was updated successfully, but these errors were encountered: