[details] plugin - spaces in tag name gobble text in v1.9beta


(Nordize) #1

Writing [details=Click here to reveal] used to work fine in v1.8. In v1.9 the words here to reveal are gobbled. Adding quotes fixes it, i.e. [details="Click here to reveal"] but this isn’t a great fix because I’d have to apply it too all older posts made before upgrading to v1.9 … which in my case are a lot.

This doesn’t work (here to reveal is gobbled):

Click here to reveal

Bleh

This works:

Click here to reveal

Bleh


Details plugin - new issues with white spaces around tag after upgrade to v1.9
Details plugin - new issues with white spaces around tag after upgrade to v1.9
(Jeff Atwood) #2

Definitely a bug @sam


(Sam Saffron) #3

BBCode is a :train2: :boom:

[elem=this is a test]
[elem a=testing 123 b="test it" c=test it]
[elem=testing this b=this is a test]
[elem='testing this']

I will add logic for this edge case.


(Jeff Atwood) #4

Well, the way we support it in our editor is by inserting this:

[details=Summary]
This text will be hidden
[/details]

It is not unreasonable to think that adding words to that would work:

[details=Summary more text]
This text will be hidden
[/details]

So we should fix our editor insertion first, if we want quotes:

[details="Summary"]
This text will be hidden
[/details]

We made up [details] it is not BBCode standard in any way.


(Nordize) #5

I believe very few people used quotes with [details] … in fact, even the official example uses it without quotes but with spaces, see discourse/plugins/discourse-details at master · discourse/discourse · GitHub

Enforcing quotes now would break a lot of posts made pre-1.9 … please don’t do that :slight_smile:

The details tag doesn’t have any attributes (afaik), it’s just [details=foo bar]. Fine to allow spaces without quotes, like before.


(Sam Saffron) #6

Fixed per:


(Sam Saffron) #7