Skip to main content
Topic: Click to expand quote (Read 5921 times) previous topic - next topic
0 Members and 2 Guests are viewing this topic.

Re: Click to expand quote

Reply #30

Have you given any thought to allowing a limitation on nested quotes? That's one of the things that gets me about SMF and Elk: You can disable nested quotes entirely, but often in a discussion it is useful to allow at least one level of nested quotes.

The problem is that if you allow nested quotes you will inevitably get people who just keep hitting the quote button, so the number of nested quotes starts going sky high. You can deal with the presentation in the thread, by using CSS to hide any quotes past any level you want, but that doesn't work in the editor. So if you want to edit a post, or reply to it, you're back to having stacks of redundant nested quotes to deal with. Not only is this a PITA for posting, it also bloats the db.

One thing phpBB did right is to allow the admin to set a limit on the number of nested quotes. Anything further down the stack gets dropped before the post is saved in the db. This solves all the problems, while keeping the good points.

Arranging this should be easier now. The new markup should mean you only have to look for quote tags, and don't have to deal with quoteheader tags as a separate issue.

Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Click to expand quote

Reply #31

Had not thought about that, but its a good idea, I kind of hate anything more than one quote anyway.

Would you drop the inner quotes or the outer quotes when over the limit?  So say you set a limit of 2 levels deep and you have original Quote -> Quote 1 -> Quote 2  Do you leave Quote -> Quote 1 or Quote 1 -> Quote 2 ??  I guess its what do we think the reply is in reference to, the original or the latest ?  Any idea what PHPBB does in this regard (yes that is lazy of me, but WTH)

Re: Click to expand quote

Reply #32

Ok, example:

Quote from: Third reply lol
Quote from: Second reply* the entire text of War & Peace here *
Quote from: First reply internet warrior psycho rant here
Quote from: Original post some text here

In this example (which accurately represents an average internet discussion) if the admin setting was 1 level of nested quotes, you would see this...

Quote from: Third reply lol
Quote from: Second reply* the entire text of War & Peace here *

If the admin setting was 2 level of nested quotes, you would see this...

Quote from: Third reply lol
Quote from: Second reply* the entire text of War & Peace here *
Quote from: First reply internet warrior psycho rant here
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Click to expand quote

Reply #33

I have what I think will work on my local.

Have to do more testing to be sure, because quotes really bite the big one.  Basically it will change the remove nested quotes option to a allowed number, 0 = the current remove all, 1 = ummm one nested ...etc etc. This change will change what is actually saved in the DB or sent to the post page,  which will save some space in the DB.

An alternative is to simply hide nested quotes, over a the limit.  The benefit here is that it is, not destructive, meaning if the admin changed their mind, and increased allowed quotes depth, they would simply show up as normal.  The downside is no saving in the DB, which is kind of how it is today if you allow nested quotes.

Preferences / Thoughts ?

Re: Click to expand quote

Reply #34

My 2c: kill it. If the admin changes their mind later, that's their problem.

All the original thread content will still be traceable via the existing linked quote headers, so there's no actual loss of discussion content. There's only a loss of pointless repetition. :) 
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Click to expand quote

Reply #35

That should now be implemented and live.

I set it at a level 2.  Of course it will only effect quotes going forward, previous deeply nested quotes would still show, although those could be hidden via CSS if really wanted.

Re: Click to expand quote

Reply #36

Just a test

QuoteLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco

QuoteLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.

QuoteLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

QuoteLorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.

Looks fine to me, the "More" button is now displayed only if there is something more to display. Great!
Last Edit: May 17, 2022, 03:08:03 am by radu81
sorry for my bad english

Re: Click to expand quote

Reply #37

Test quoting my earlier post...

Quote from: Antechinus – Ok, example:

Quote from: Third reply lol
Quote from: Second reply* the entire text of War & Peace here *

In this example (which accurately represents an average internet discussion) if the admin setting was 1 level of nested quotes, you would see this...

Quote from: Third reply lol
Quote from: Second reply* the entire text of War & Peace here *

If the admin setting was 2 level of nested quotes, you would see this...

Quote from: Third reply lol
Quote from: Second reply* the entire text of War & Peace here *

ETA: Seems to do what it says on the tin. :) Now to try it with something else...

Quote from: Third reply lol
Quote from: Second reply* the entire text of War & Peace here *
Code: [Select]
		/*--- Quote tag variations. ---*/
'~<QUOTE author=\\"(.+?)\\" post_id=\\"(.+?)\\" time=\\"(.+?)\\" user_id=\\"(.+?)\\"><s>(.+?)</s>~s',
'~<QUOTE author=\\"(.+?)\\"><s>(.+?)</s>~s',
'~<QUOTE><s>\[quote]</s>~s',
'~<e>\[/quote]</e></QUOTE>~s',
/*--- Code boxes: first case is an odd one. ---*/
'~<CODE><s>\[code]</s><i>\\n</i>~s',
'~<CODE><s>\[code]</s>~s',
'~<e>\
</e></CODE>~s',
      /*--- List types: decimal, lower-alpha, upper-alpha, lower-roman, upper-roman... ---*/
      '~<LIST type="(.+?)">(.+?)~s',
      '~<LIST>\
    ~s',
          '~<e>\
</e></LIST>~s',
      '~<LI>\[\*]~s',
      '~</LI>~s',[/code]

Ok, here's a bug for you. When I test post a code box containing regex*,  it breaks at one of the code tags nested in the regex.

IOW, it can't recognise that anything inside a code tag is code, even if it's another BBC tag.

This may be a general Elk bug, not specifically a bug in handling nested quotes. Not sure yet. I grabbed this example regex at random, just noticed the result, and haven't yet done any further testing. :)

Admittedly this is a particularly nasty edge case. Not sure it is worth attempting a bulletproof fix. Check it out in the BBC editor mode to see what is happening. ;)

*(example is from an updated phpBB > SMF/Elk converter I'm working on)
Last Edit: May 18, 2022, 07:05:45 pm by Antechinus
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

 

Re: Click to expand quote

Reply #38

Interesting, that blew right through the tag ... to investigate!  Thanks for the report.

Re: Click to expand quote

Reply #39

I’d argue not a bug… how could it possibly know that [/code] is on this one occasion is different to [/code] to indicate “I’m done with the code now”?

The only way around this would be to assume that the end of a code block must start on a new line which will play hell with converters, not to mention making the code tag even more of a special case than it already is (and behave differently to everything else, e.g. quote where the end tag doesn’t have to be the only thing on the line)

Re: Click to expand quote

Reply #40

After taking a quick look at that, I'm going to agree with not a:bug::D

I thought there may be a way in preparse to catch/fix the issue but there really is no great or even good way to do that.  Its even worse as the open/close tags are not balanced in the example which just makes it even worse as its already nested inside another parent tag. 

There may be potential to catch it in the editor, but that will be very specific use case.  I'm thinking you use the toolbar to open a set of code tags, then one could capture all the items added between those markers and protect them, but there are others ways to add stuff that will cause that to fail.

Re: Click to expand quote

Reply #41

Fair enough. No point turning such an edge case into a major bunfight. Any time I really need to post something like that in a code box I can easily do [ /code] for the example (with a note about the extra space). Anyone messing with regex will know enough to be able to figure that out. ;)
Master of Expletives: Now with improved family f@&king friendliness! :D

Sources code: making easy front end changes difficult since 1873. :P

Re: Click to expand quote

Reply #42

Just to close this (maybe :D) I made the last tweaks where I finally added a touch of JavaScript to control the overlay.  The pure PHP/CSS thing worked well enough but was not as responsive as it needed to be.  It was basically having to look at content length (words or newlines) and decide when to add or not the overlay.  It was just a fun little experiment.

That was is of course is a problem when you shrink your screen etc, so JavaScript :star_struck:  to the rescue.  Now it simply applies the overlay to everything, JS checks the height of the overall quote and leaves, or removes, the overlay.  Pretty similar to how code blocks work.  Anyway should look the same but just be a bit more sensible in how it acts on all screen sizes.

Re: Click to expand quote

Reply #43

I would like to suggest a minor change for this: add own translation for the text "More". If I am not wrong it uses the same "More" text from here:
2022-11-27_11-35.png
In this way it's much easier to translate. In my case "More" under every post is translated as "Other options" while "More" under the quoted text should be something like "Read more" or "Click to expand".
What do you think?
sorry for my bad english

Re: Click to expand quote

Reply #44

Indeed I reused the string, providing a unique one is a good idea. 

We can just add a new $txt['quote_expand'] = '???; to the same file.  Expand Quote, Show More, Show Entire Quote, Read More or Click to expand all seem like good choices.