Skip to content

Commit

Permalink
Merge pull request #19 from natedrake/dev
Browse files Browse the repository at this point in the history
list style change
  • Loading branch information
natedrake authored Mar 26, 2017
2 parents b9ff007 + c6a2e5e commit f508a87
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions src/Dumper.php
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,14 @@ public function parse()
*/
$items=explode("\n", ltrim(rtrim($element->value[3])));

$return.='<ul style="list-style: disc;">';
$return.='<ul style="list-style: disc;padding-left:0px;">';
$return.='<span style="font-size:1.1em;">'.$element->value[1].'</span>';
/**
* @note iterate through each item, removing prefix ` - `
*/
foreach($items as $item) {
$i=preg_replace('/^\-[\s]/', '',ltrim($item));
$return.='<li style="margin-left: 20px;">'.$i.'</li>';
$return.='<li style="margin-left: 30px;">'.$i.'</li>';
}
$return.='</ul>';
break;
Expand All @@ -112,14 +112,14 @@ public function parse()
*/
$items=explode("\n", ltrim(rtrim($element->value[2])));

$return.='<ol>';
$return.='<ol style="padding-left: 0px;">';
$return.='<span style="font-size:1.1em;">'.$element->value[1].'</span>';
/**
* @note iterate through each item removing prefix ` . `
*/
foreach ($items as $item) {
$i=preg_replace('/^[\d][\.]/', '',ltrim($item));
$return.='<li style="margin-left: 20px;">'.$i.'</li>';
$return.='<li style="margin-left: 30px;">'.$i.'</li>';
}
$return.='</ol>';
break;
Expand Down
4 changes: 2 additions & 2 deletions tests/src/MarkdownTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ public function testUnorderedList()
- Hash Class
- Input Class
";
$markup='<ul style="list-style: disc;"><span style="font-size:1.1em;">Contains:</span><li style="margin-left: 20px;">MVC Framework</li><li style="margin-left: 20px;">ORM Framework</li><li style="margin-left: 20px;">Hash Class</li><li style="margin-left: 20px;">Input Class</li></ul>';
$markup='<ul style="list-style: disc;padding-left:0px;"><span style="font-size:1.1em;">Contains:</span><li style="margin-left: 30px;">MVC Framework</li><li style="margin-left: 30px;">ORM Framework</li><li style="margin-left: 30px;">Hash Class</li><li style="margin-left: 30px;">Input Class</li></ul>';
$bootstrap=new BootStrap($markdown);
$this->assertEquals($markup, $bootstrap->dumper->parse());
}
Expand All @@ -160,7 +160,7 @@ public function testOrderedList()
4. Hash Class
3. Input Class
";
$markup='<ol><span style="font-size:1.1em;">Contains:</span><li style="margin-left: 20px;"> MVC Framework</li><li style="margin-left: 20px;"> ORM Framework</li><li style="margin-left: 20px;"> Hash Class</li><li style="margin-left: 20px;"> Input Class</li></ol>';
$markup='<ol style="padding-left: 0px;"><span style="font-size:1.1em;">Contains:</span><li style="margin-left: 30px;"> MVC Framework</li><li style="margin-left: 30px;"> ORM Framework</li><li style="margin-left: 30px;"> Hash Class</li><li style="margin-left: 30px;"> Input Class</li></ol>';
$bootstrap=new BootStrap($markdown);
$this->assertEquals($markup, $bootstrap->dumper->parse());
}
Expand Down

0 comments on commit f508a87

Please sign in to comment.