BookStackApp / BookStack

A platform to create documentation/wiki content built with PHP & Laravel
https://www.bookstackapp.com/
MIT License
15.22k stars 1.9k forks source link

Can't dismiss callout #3707

Open SonGokussj4 opened 2 years ago

SonGokussj4 commented 2 years ago

Describe the Bug

When I write something into callout and it's the last line in book (I don't have any paragraphs or text under) and press Enter, new line with new callout appears. If I press Backspace, it disappears but the cursor goes to the previous callout.

Right now when:

Expected behavior:

Steps to Reproduce

As written above

Expected Behaviour

As written above

Screenshots or Additional Context

No response

Browser Details

Chrome 105.0.5195.102

Exact BookStack Version

v22.07.03

PHP Version

No response

Hosting Environment

Docker / Docker-compose

SonGokussj4 commented 2 years ago

Hi. The similar is happening with inline_code.

New line is starting as inline code. Normal <p> would be preferred.

Wrong way to dismiss:

Funny enough, if I repeat enter and backspace a few times, this happens: image

Correct way to dismiss:

ssddanbrown commented 2 years ago

Dev findings for callouts

Setting tinymce keep_styles option to false will clear on newline, but will affect current format handling in such cases for all block types. Option usage in tinymce src here:

https://github.com/tinymce/tinymce/blob/f65c926ace4ae3f68f8c08a1f6a4b693fc26e241/modules/tinymce/src/core/main/ts/newline/InsertBlock.ts#L267-L270

No additional control possible by the looks of things via specific format. Can possibly hook into custom event to handle specific cases we're attempting to address:

https://github.com/tinymce/tinymce/blob/f65c926ace4ae3f68f8c08a1f6a4b693fc26e241/modules/tinymce/src/core/main/ts/newline/InsertBlock.ts#L497

rgkirch commented 1 year ago

I have a document ending with a callout and I don't know how to dismiss it. I've tried using the arrow keys, clicking around, enter and backspace. I can't find any way to continue editing the document outside of the callout.

rgkirch commented 1 year ago

Is there a workaround?

rgkirch commented 1 year ago

Oh, I can make a new empty one and then toggle "large header" on and off.