Skip to content

Commit f4d13f6

Browse files
committed
close #22
1 parent d6d6f8a commit f4d13f6

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/Documents/HtmlDocument.php

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<?php
22

33
/*
4-
* This file is part of Chevere.
4+
* This file is part of Chevereto.
55
*
6-
* (c) Rodolfo Berrios <rodolfo@chevere.org>
6+
* (c) Rodolfo Berrios <rodolfo@chevereto.com>
77
*
88
* For the full copyright and license information, please view the LICENSE
99
* file that was distributed with this source code.
@@ -37,7 +37,7 @@ final class HtmlDocument extends Document
3737
HTML;
3838

3939
public const NO_DEBUG_BODY_HTML = <<<HTML
40-
<main class="user-select-none"><div>%content%</div></main>
40+
<main><div>%content%</div></main>
4141
HTML;
4242

4343
public const DEBUG_BODY_HTML = <<<HTML
@@ -55,6 +55,7 @@ public function getTemplate(): array
5555
if (! $this->handler->isDebug()) {
5656
$template = [
5757
self::SECTION_TITLE => $template[self::SECTION_TITLE],
58+
static::SECTION_EXTRA => $this->getSectionExtra(),
5859
];
5960
}
6061

@@ -63,6 +64,7 @@ public function getTemplate(): array
6364

6465
public function getContent(string $content, string $handle = ''): string
6566
{
67+
$handle = strtolower(preg_replace('/[^a-zA-Z0-9_-]/', '-', $handle));
6668
$classAttr = 'class="' . $handle . '"';
6769

6870
return "<div {$classAttr}>{$content}</div>";
@@ -73,11 +75,11 @@ public function getSectionTitle(): string
7375
if (! $this->handler->isDebug()) {
7476
return $this->format->getWrapTitle(self::NO_DEBUG_TITLE_PLAIN)
7577
. self::NO_DEBUG_CONTENT_HTML
76-
. '<p><span class="user-select-all">'
78+
. '<div><span class="user-select-all">'
7779
. self::TAG_DATE_TIME_UTC_ATOM
7880
. '</span> • <span class="user-select-all">'
7981
. self::TAG_ID
80-
. '</span></p>';
82+
. '</span></div>';
8183
}
8284

8385
return $this->format->getWrapTitle(

tests/Documents/HtmlDocumentTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function testHandlerDebugOff(): void
6767
$this->assertStringContainsString('<meta charset="utf-8">', $string);
6868
$this->assertStringContainsString('Something went wrong', $string);
6969
$this->assertStringContainsString('Please try again later.', $string);
70-
$this->assertStringContainsString('<main class="user-select-none"><div>', $string);
70+
$this->assertStringContainsString('<main><div>', $string);
7171
$this->assertStringContainsString('</span> • <span class="user-select-all">', $string);
7272
}
7373
}

0 commit comments

Comments
 (0)