Skip to content

Commit 94b0f70

Browse files
committed
Merge branch 'development' into release
2 parents 08b2a77 + 36d7ff7 commit 94b0f70

File tree

8 files changed

+44
-27
lines changed

8 files changed

+44
-27
lines changed

app/Entities/Tools/PageContent.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,9 @@ protected function formatHtml(string $htmlText): string
239239
$html .= $doc->saveHTML($childNode);
240240
}
241241

242+
// Perform required string-level tweaks
243+
$html = str_replace(' ', ' ', $html);
244+
242245
return $html;
243246
}
244247

resources/js/wysiwyg/config.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,15 @@ export function build(options) {
221221
// Build toolbar content
222222
const {toolbar, groupButtons: toolBarGroupButtons} = buildToolbar(options);
223223

224+
// BookStack Version
225+
const version = document.querySelector('script[src*="/dist/app.js"]').getAttribute('src').split('?version=')[1];
226+
224227
// Return config object
225228
return {
226229
width: '100%',
227230
height: '100%',
228231
selector: '#html-editor',
232+
cache_suffix: '?version=' + version,
229233
content_css: [
230234
window.baseUrl('/dist/styles.css'),
231235
],
@@ -239,6 +243,7 @@ export function build(options) {
239243
remove_script_host: false,
240244
document_base_url: window.baseUrl('/'),
241245
end_container_on_empty_block: true,
246+
remove_trailing_brs: false,
242247
statusbar: false,
243248
menubar: false,
244249
paste_data_images: false,

resources/lang/it/editor.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -131,12 +131,12 @@
131131
'open_link' => 'Apri collegamento in...',
132132
'open_link_current' => 'Finestra corrente',
133133
'open_link_new' => 'Nuova finestra',
134-
'insert_collapsible' => 'Insert collapsible block',
135-
'collapsible_unwrap' => 'Unwrap',
136-
'edit_label' => 'Edit label',
137-
'toggle_open_closed' => 'Toggle open/closed',
138-
'collapsible_edit' => 'Edit collapsible block',
139-
'toggle_label' => 'Toggle label',
134+
'insert_collapsible' => 'Inserisci blocco collassabile',
135+
'collapsible_unwrap' => 'Espandi',
136+
'edit_label' => 'Modifica etichetta',
137+
'toggle_open_closed' => 'Espandi/Comprimi',
138+
'collapsible_edit' => 'Modifica blocco collassabile',
139+
'toggle_label' => 'Attiva/Disattiva etichetta',
140140

141141
// About view
142142
'about_title' => 'Informazioni sull\'editor di WYSIWYG',

resources/sass/_blocks.scss

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,13 +238,13 @@
238238
}
239239

240240
.fade-in-when-active {
241-
opacity: 0.6;
241+
@include lightDark(opacity, 0.6, 0.7);
242242
transition: opacity ease-in-out 120ms;
243243
&:hover, &:focus-within {
244-
opacity: 1;
244+
opacity: 1 !important;
245245
}
246246
@media (prefers-contrast: more) {
247-
opacity: 1;
247+
opacity: 1 !important;
248248
}
249249
}
250250

resources/sass/_layout.scss

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -361,16 +361,13 @@ body.flexbox {
361361
display: none;
362362
}
363363
.tri-layout-left-contents > *, .tri-layout-right-contents > * {
364-
opacity: 0.6;
364+
@include lightDark(opacity, 0.6, 0.7);
365365
transition: opacity ease-in-out 120ms;
366-
&:hover {
367-
opacity: 1;
368-
}
369-
&:focus-within {
370-
opacity: 1;
366+
&:hover, &:focus-within {
367+
opacity: 1 !important;
371368
}
372369
@media (prefers-contrast: more) {
373-
opacity: 1;
370+
opacity: 1 !important;
374371
}
375372
}
376373

resources/sass/_lists.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@
193193
}
194194
}
195195
.entity-list-item.selected {
196-
background-color: rgba(0, 0, 0, 0.08);
196+
@include lightDark(background-color, rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.08));
197197
}
198198
.entity-list-item.no-hover {
199199
margin-top: -$-xs;

resources/sass/_pages.scss

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -164,6 +164,10 @@ body.tox-fullscreen, body.markdown-fullscreen {
164164
clear: both;
165165
}
166166

167+
p:empty {
168+
min-height: 1.6em;
169+
}
170+
167171
&.page-revision {
168172
pre code {
169173
white-space: pre-wrap;

tests/Entity/PageContentTest.php

Lines changed: 18 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -692,35 +692,43 @@ public function test_markdown_base64_extract_not_limited_by_pcre_limits()
692692

693693
public function test_base64_images_within_markdown_blanked_if_not_supported_extension_for_extract()
694694
{
695-
$this->asEditor();
696695
$page = Page::query()->first();
697696

698-
$this->put($page->getUrl(), [
697+
$this->asEditor()->put($page->getUrl(), [
699698
'name' => $page->name, 'summary' => '',
700699
'markdown' => 'test ![test](data:image/jiff;base64,' . $this->base64Jpeg . ')',
701700
]);
702701

703-
$page->refresh();
704-
$this->assertStringContainsString('<img src=""', $page->html);
702+
$this->assertStringContainsString('<img src=""', $page->refresh()->html);
705703
}
706704

707705
public function test_nested_headers_gets_assigned_an_id()
708706
{
709-
$this->asEditor();
710707
$page = Page::query()->first();
711708

712709
$content = '<table><tbody><tr><td><h5>Simple Test</h5></td></tr></tbody></table>';
713-
$this->put($page->getUrl(), [
710+
$this->asEditor()->put($page->getUrl(), [
714711
'name' => $page->name,
715712
'html' => $content,
716-
'summary' => '',
717713
]);
718714

719-
$updatedPage = Page::query()->where('id', '=', $page->id)->first();
720-
721715
// The top level <table> node will get assign the bkmrk-simple-test id because the system will
722716
// take the node value of h5
723717
// So the h5 should get the bkmrk-simple-test-1 id
724-
$this->assertStringContainsString('<h5 id="bkmrk-simple-test-1">Simple Test</h5>', $updatedPage->html);
718+
$this->assertStringContainsString('<h5 id="bkmrk-simple-test-1">Simple Test</h5>', $page->refresh()->html);
719+
}
720+
721+
public function test_non_breaking_spaces_are_preserved()
722+
{
723+
/** @var Page $page */
724+
$page = Page::query()->first();
725+
726+
$content = '<p>&nbsp;</p>';
727+
$this->asEditor()->put($page->getUrl(), [
728+
'name' => $page->name,
729+
'html' => $content,
730+
]);
731+
732+
$this->assertStringContainsString('<p id="bkmrk-%C2%A0">&nbsp;</p>', $page->refresh()->html);
725733
}
726734
}

0 commit comments

Comments
 (0)