Skip to content

Commit e783dd9

Browse files
author
Edward
committed
Removed redundant tags
1 parent f9b32a0 commit e783dd9

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

src/Parser.php

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,10 @@ private function parseDelimiter($block)
156156

157157
private function parseCode($block)
158158
{
159-
$wrapper = $this->dom->createElement('div');
160-
161-
$wrapper->setAttribute('class', "{$this->prefix}-code");
162-
163159
$pre = $this->dom->createElement('pre');
164160

161+
$pre->setAttribute('class', $this->addClass($block->type));
162+
165163
$code = $this->dom->createElement('code');
166164

167165
$content = new DOMText($block->data->code);
@@ -170,9 +168,7 @@ private function parseCode($block)
170168

171169
$pre->appendChild($code);
172170

173-
$wrapper->appendChild($pre);
174-
175-
$this->dom->appendChild($wrapper);
171+
$this->dom->appendChild($pre);
176172
}
177173

178174
private function parseParagraph($block)
@@ -431,12 +427,15 @@ private function parseStandardImage($block)
431427

432428
private function parseQuote($block)
433429
{
430+
$alignment = isset($block->data->alignment) ? $block->data->alignment : false;
431+
432+
$class = $this->addClass($block->type, $alignment);
433+
434434
$figure = $this->dom->createElement('figure');
435-
$figure->setAttribute('class', "{$this->prefix}-quote");
435+
$figure->setAttribute('class', $class);
436436

437437
$blockquote = $this->dom->createElement('blockquote');
438438

439-
$blockquote->setAttribute('class', "{$this->prefix}-blockquote");
440439
$blockquote->appendChild($this->html5->loadHTMLFragment($block->data->text));
441440
$figure->appendChild($blockquote);
442441

0 commit comments

Comments
 (0)