mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-16 08:18:53 +00:00
Merge branch '3.2.x'
* 3.2.x: [ticket/15637] Remove trailing space from description [ticket/15637] Preserve line breaks in event descriptions [ticket/15637] Updated test fixture to include complete event description [ticket/15637] Remove trailing space from description [ticket/15637] Fixed removing white-spaces from description line [ticket/15637] Extract all lines before the first @tag [ticket/15637] Extract multi-line PHP event descriptions
This commit is contained in:
commit
6c53a68ee1
3 changed files with 26 additions and 3 deletions
|
@ -264,7 +264,30 @@ class php_exporter
|
||||||
|
|
||||||
// Find event description line
|
// Find event description line
|
||||||
$description_line_num = $this->find_description();
|
$description_line_num = $this->find_description();
|
||||||
$description = substr(trim($this->file_lines[$description_line_num]), strlen('* '));
|
$description_lines = array();
|
||||||
|
|
||||||
|
while (true)
|
||||||
|
{
|
||||||
|
$description_line = substr(trim($this->file_lines[$description_line_num]), strlen('*'));
|
||||||
|
$description_line = trim(str_replace("\t", " ", $description_line));
|
||||||
|
|
||||||
|
// Reached end of description if line is a tag
|
||||||
|
if (strlen($description_line) && $description_line[0] == '@')
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
$description_lines[] = $description_line;
|
||||||
|
$description_line_num++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// If there is an empty line between description and first tag, remove it
|
||||||
|
if (!strlen(end($description_lines)))
|
||||||
|
{
|
||||||
|
array_pop($description_lines);
|
||||||
|
}
|
||||||
|
|
||||||
|
$description = trim(implode('<br/>', $description_lines));
|
||||||
|
|
||||||
if (isset($this->events[$this->current_event]))
|
if (isset($this->events[$this->current_event]))
|
||||||
{
|
{
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
/**
|
/**
|
||||||
* Description
|
* Description
|
||||||
*
|
*
|
||||||
* NOTE: This will not be exported
|
* NOTE: This will also be exported
|
||||||
*
|
*
|
||||||
* @event extra_description.dispatch
|
* @event extra_description.dispatch
|
||||||
* @since 3.1.0-b2
|
* @since 3.1.0-b2
|
||||||
|
|
|
@ -57,7 +57,7 @@ class phpbb_event_php_exporter_test extends phpbb_test_case
|
||||||
'file' => 'extra_description.test',
|
'file' => 'extra_description.test',
|
||||||
'arguments' => array(),
|
'arguments' => array(),
|
||||||
'since' => '3.1.0-b2',
|
'since' => '3.1.0-b2',
|
||||||
'description' => 'Description',
|
'description' => 'Description<br/><br/>NOTE: This will also be exported',
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
Loading…
Add table
Reference in a new issue