Merge branch 'development' into release

This commit is contained in:
Dan Brown 2022-03-01 22:45:12 +00:00
commit 94b0f70bfa
No known key found for this signature in database
GPG Key ID: 46D9F943C24A2EF9
8 changed files with 44 additions and 27 deletions

View File

@ -239,6 +239,9 @@ class PageContent
$html .= $doc->saveHTML($childNode); $html .= $doc->saveHTML($childNode);
} }
// Perform required string-level tweaks
$html = str_replace(' ', ' ', $html);
return $html; return $html;
} }

View File

@ -221,11 +221,15 @@ export function build(options) {
// Build toolbar content // Build toolbar content
const {toolbar, groupButtons: toolBarGroupButtons} = buildToolbar(options); const {toolbar, groupButtons: toolBarGroupButtons} = buildToolbar(options);
// BookStack Version
const version = document.querySelector('script[src*="/dist/app.js"]').getAttribute('src').split('?version=')[1];
// Return config object // Return config object
return { return {
width: '100%', width: '100%',
height: '100%', height: '100%',
selector: '#html-editor', selector: '#html-editor',
cache_suffix: '?version=' + version,
content_css: [ content_css: [
window.baseUrl('/dist/styles.css'), window.baseUrl('/dist/styles.css'),
], ],
@ -239,6 +243,7 @@ export function build(options) {
remove_script_host: false, remove_script_host: false,
document_base_url: window.baseUrl('/'), document_base_url: window.baseUrl('/'),
end_container_on_empty_block: true, end_container_on_empty_block: true,
remove_trailing_brs: false,
statusbar: false, statusbar: false,
menubar: false, menubar: false,
paste_data_images: false, paste_data_images: false,

View File

@ -131,12 +131,12 @@ return [
'open_link' => 'Apri collegamento in...', 'open_link' => 'Apri collegamento in...',
'open_link_current' => 'Finestra corrente', 'open_link_current' => 'Finestra corrente',
'open_link_new' => 'Nuova finestra', 'open_link_new' => 'Nuova finestra',
'insert_collapsible' => 'Insert collapsible block', 'insert_collapsible' => 'Inserisci blocco collassabile',
'collapsible_unwrap' => 'Unwrap', 'collapsible_unwrap' => 'Espandi',
'edit_label' => 'Edit label', 'edit_label' => 'Modifica etichetta',
'toggle_open_closed' => 'Toggle open/closed', 'toggle_open_closed' => 'Espandi/Comprimi',
'collapsible_edit' => 'Edit collapsible block', 'collapsible_edit' => 'Modifica blocco collassabile',
'toggle_label' => 'Toggle label', 'toggle_label' => 'Attiva/Disattiva etichetta',
// About view // About view
'about_title' => 'Informazioni sull\'editor di WYSIWYG', 'about_title' => 'Informazioni sull\'editor di WYSIWYG',

View File

@ -238,13 +238,13 @@
} }
.fade-in-when-active { .fade-in-when-active {
opacity: 0.6; @include lightDark(opacity, 0.6, 0.7);
transition: opacity ease-in-out 120ms; transition: opacity ease-in-out 120ms;
&:hover, &:focus-within { &:hover, &:focus-within {
opacity: 1; opacity: 1 !important;
} }
@media (prefers-contrast: more) { @media (prefers-contrast: more) {
opacity: 1; opacity: 1 !important;
} }
} }

View File

@ -361,16 +361,13 @@ body.flexbox {
display: none; display: none;
} }
.tri-layout-left-contents > *, .tri-layout-right-contents > * { .tri-layout-left-contents > *, .tri-layout-right-contents > * {
opacity: 0.6; @include lightDark(opacity, 0.6, 0.7);
transition: opacity ease-in-out 120ms; transition: opacity ease-in-out 120ms;
&:hover { &:hover, &:focus-within {
opacity: 1; opacity: 1 !important;
}
&:focus-within {
opacity: 1;
} }
@media (prefers-contrast: more) { @media (prefers-contrast: more) {
opacity: 1; opacity: 1 !important;
} }
} }

View File

@ -193,7 +193,7 @@
} }
} }
.entity-list-item.selected { .entity-list-item.selected {
background-color: rgba(0, 0, 0, 0.08); @include lightDark(background-color, rgba(0, 0, 0, 0.08), rgba(255, 255, 255, 0.08));
} }
.entity-list-item.no-hover { .entity-list-item.no-hover {
margin-top: -$-xs; margin-top: -$-xs;

View File

@ -164,6 +164,10 @@ body.tox-fullscreen, body.markdown-fullscreen {
clear: both; clear: both;
} }
p:empty {
min-height: 1.6em;
}
&.page-revision { &.page-revision {
pre code { pre code {
white-space: pre-wrap; white-space: pre-wrap;

View File

@ -692,35 +692,43 @@ class PageContentTest extends TestCase
public function test_base64_images_within_markdown_blanked_if_not_supported_extension_for_extract() public function test_base64_images_within_markdown_blanked_if_not_supported_extension_for_extract()
{ {
$this->asEditor();
$page = Page::query()->first(); $page = Page::query()->first();
$this->put($page->getUrl(), [ $this->asEditor()->put($page->getUrl(), [
'name' => $page->name, 'summary' => '', 'name' => $page->name, 'summary' => '',
'markdown' => 'test ![test](data:image/jiff;base64,' . $this->base64Jpeg . ')', 'markdown' => 'test ![test](data:image/jiff;base64,' . $this->base64Jpeg . ')',
]); ]);
$page->refresh(); $this->assertStringContainsString('<img src=""', $page->refresh()->html);
$this->assertStringContainsString('<img src=""', $page->html);
} }
public function test_nested_headers_gets_assigned_an_id() public function test_nested_headers_gets_assigned_an_id()
{ {
$this->asEditor();
$page = Page::query()->first(); $page = Page::query()->first();
$content = '<table><tbody><tr><td><h5>Simple Test</h5></td></tr></tbody></table>'; $content = '<table><tbody><tr><td><h5>Simple Test</h5></td></tr></tbody></table>';
$this->put($page->getUrl(), [ $this->asEditor()->put($page->getUrl(), [
'name' => $page->name, 'name' => $page->name,
'html' => $content, 'html' => $content,
'summary' => '',
]); ]);
$updatedPage = Page::query()->where('id', '=', $page->id)->first();
// The top level <table> node will get assign the bkmrk-simple-test id because the system will // The top level <table> node will get assign the bkmrk-simple-test id because the system will
// take the node value of h5 // take the node value of h5
// So the h5 should get the bkmrk-simple-test-1 id // So the h5 should get the bkmrk-simple-test-1 id
$this->assertStringContainsString('<h5 id="bkmrk-simple-test-1">Simple Test</h5>', $updatedPage->html); $this->assertStringContainsString('<h5 id="bkmrk-simple-test-1">Simple Test</h5>', $page->refresh()->html);
}
public function test_non_breaking_spaces_are_preserved()
{
/** @var Page $page */
$page = Page::query()->first();
$content = '<p>&nbsp;</p>';
$this->asEditor()->put($page->getUrl(), [
'name' => $page->name,
'html' => $content,
]);
$this->assertStringContainsString('<p id="bkmrk-%C2%A0">&nbsp;</p>', $page->refresh()->html);
} }
} }