[Hide Details] Button not functioning: splitting text into multiple details!

Hi, I’m not a host but rather a user of the WaniKani forums, and since this was not a bug for them, I thought I wouldn’t pester Viet. Any Details-related bugs that came up in the search were locked.

So first of all, writing the Details tag manually around the text does not seem to be working. So then I thought I was typing it incorrectly/didn’t leave enough spaces before/after my text.
So I tried using the button under the GEAR button to add details to selected text:

This used to function normally as desired, and then you could replace “Summary” with whatever title your heart desired. However over here at this post the button instead applied the details tag around every separate line of text. Seeing this in my text box, I didn’t even bother to edit my post, but instead came here to report it. I shall try to recreate it here as an example, because it is very odd behaviour.

Summary

Hello, this is a block of text.

Summary

It has multiple lines, because I like the enter key.

Summary

Doesn’t everyone?

Summary

Extra text to prove my point.

EDIT: That was a small four-line paragraph with enters between each line. And that’s what the Details Button did to my text. Point proven. Very easy to replicate. Not just a problem at community.wanikani.com.

Anyone else having this issue?

1 Like

Reproduced this on meta:

// If the editor contains the following text
first line
second line

// Selecting them and clicking the `Hide Details` button would produce:
[details="Summary"]
first line
[/details]


[details="Summary"]
second line
[/details]

// While the desired behaviour should produce:
[details="Summary"]
first line
second line
[/details]

Took the liberty to fix it and added a test:

https://github.com/discourse/discourse/pull/5290


P.S. I did notice @sam’s previous commit, but I believe the { multiline: true } change was unintentional.

6 Likes

Hmm is this a regression @sam?

I guess it is … looks like it.

1 Like

This topic was automatically closed after 41 hours. New replies are no longer allowed.