Skip to content

Commit 47f082c

Browse files
committed
Comments: Added HTML filter test, fixed placeholder in dark mode
1 parent fee9045 commit 47f082c

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

resources/sass/_tinymce.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
padding: 1rem;
3535
top: 4px;
3636
font-style: italic;
37-
color: rgba(34,47,62,.5)
37+
@include lightDark(color, rgba(34,47,62,.5), rgba(155,155,155,.5))
3838
}
3939

4040
// Default styles for our custom root nodes

tests/Entity/CommentTest.php

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,29 @@ public function test_scripts_are_removed_even_if_already_in_db()
117117
$resp->assertDontSee('superbadonclick', false);
118118
}
119119

120+
public function test_comment_html_is_limited()
121+
{
122+
$page = $this->entities->page();
123+
$input = '<h1>Test</h1><p id="abc" href="beans">Content<a href="#cat" data-a="b">a</a><section>Hello</section></p>';
124+
$expected = '<p>Content<a href="#cat">a</a></p>';
125+
126+
$resp = $this->asAdmin()->post("/comment/{$page->id}", ['html' => $input]);
127+
$resp->assertOk();
128+
$this->assertDatabaseHas('comments', [
129+
'entity_type' => 'page',
130+
'entity_id' => $page->id,
131+
'html' => $expected,
132+
]);
133+
134+
$comment = $page->comments()->first();
135+
$resp = $this->put("/comment/{$comment->id}", ['html' => $input]);
136+
$resp->assertOk();
137+
$this->assertDatabaseHas('comments', [
138+
'id' => $comment->id,
139+
'html' => $expected,
140+
]);
141+
}
142+
120143
public function test_reply_comments_are_nested()
121144
{
122145
$this->asAdmin();

0 commit comments

Comments
 (0)