The editor toolbar generates invalid multi-paragraph spoilers. To reproduce the issue, select two paragraphs with double line breaks, click the gear, and click “Blur Spoiler.” The actual output is an inline spoiler that does not render correctly.
dfabulich reports that the bug is still present, despite claims that it was fixed. The expected behavior is to insert spoiler tags at the start and end of the selection, creating a multi-paragraph spoiler block.
codinghorror agrees that the editor should add spoiler BBCode tags at the top and bottom of the selection, and sam notes that the code toolbar button already works this way for inline spoilers.
zogstrip mentions that supporting mixed formatting within a spoiler block is not possible due to limitations in BBCode. However, codinghorror and sam argue that fixing the toolbar to use “block mode” for multi-line selections is a simple solution.
The issue has been assigned to pmusaraj, who has fixed the problem via two commits, making the toolbar button use “block mode” for multi-line selections.
Select the paragraphs, click the gear, and click “Blur Spoiler.”
Actual: The editor inserts spoiler tags inline at the start/end of the selection, which used to work, but which no longer makes a multi-paragraph spoiler.
Note that it should also do the right thing if you select the spoilers in this example:
foo Rosebud is a sled
Bruce Willis died in Act 1
It was Kevin Spacey the whole time
Darth is Anakin bar
Currently it does this:
foo [spoiler]Rosebud is a sled
Bruce Willis died in Act 1
It was Kevin Spacey the whole time
Darth is Anakin[/spoiler] bar
I’m not 100% sure what it should do in this case. One thing it might do is convert the inline spoilers into a spoiler block like this.
foo
[spoiler]
Rosebud is a sled
Bruce Willis died in Act 1
It was Kevin Spacey the whole time
Darth is Anakin
[/spoiler]
bar
foo
Rosebud is a sled
Bruce Willis died in Act 1
It was Kevin Spacey the whole time
Darth is Anakin
bar
But perhaps instead it should wrap each inline section with its own [spoiler] tag and embed all of the paragraphs in a spoiler block.
foo [spoiler]Rosebud is a sled[/spoiler]
[spoiler]
Bruce Willis died in Act 1
It was Kevin Spacey the whole time
[/spoiler]
[spoiler]Darth is Anakin[/spoiler] bar
foo Rosebud is a sled
Bruce Willis died in Act 1
It was Kevin Spacey the whole time
Darth is Anakin bar
But that introduces three spoilers; you have to click on each spoiler one at a time to reveal it.
Sì, non è una correzione di markdown, ma semplicemente un aggiustamento al modo in cui funziona la barra degli strumenti: la barra degli strumenti introduce un markdown errato e deve essere più intelligente nell’aggiungere le nuove righe.
@pmusaraj puoi darci un’occhiata? La selezione e i pulsanti nell’editor sono stati testati molto bene, quindi dovrebbe essere abbastanza ovvio come creare un test per questa situazione.
Questo dovrebbe essere risolto tramite questi due commit (core, discourse-spoiler-alert): il pulsante della barra degli strumenti utilizzerà la “modalità blocco” se la stringa selezionata è su più righe.