BBcode lcase-ucase -- Lowercase to Uppercase and vice versa

Get help developing custom BBCodes or request one.
User avatar
mrgoldy
Jr. Extension Validator
Posts: 1043
Joined: Tue Oct 06, 2009 7:34 pm
Location: The Netherlands
Name: Gijs

Re: BBcode ucase -- Lowercase to Uppercase

Post by mrgoldy » Fri May 17, 2019 11:10 am

That picture did help out a lot.
Unfortunately I couldn't find a solution to it.
As soon as you cast a filter (preFilter= or postFilter=) over the value, the line breaks are removed.

However, what I just realised, you can also use CSS.
BBCode: [lower]{TEXT}[/lower]
HTML: <span style="text-transform: lowercase;">{TEXT}</span>

And if you do not want the in-line style, you can just add a class to your stylesheets, like styles/your_style/theme/common.css and use that instead within the html replacement: <span class="lower">{TEXT}</span>

Code: Select all

.lower {
	text-transform: lowercase;
}
phpBB Studio / ''Proud member of the Studio"

User avatar
EA117
Registered User
Posts: 604
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: BBcode ucase -- Lowercase to Uppercase

Post by EA117 » Fri May 17, 2019 12:24 pm

mrgoldy wrote:
Fri May 17, 2019 11:10 am
However, what I just realised, you can also use CSS.
Yeah, I fell into that hole, too. They already clarified the existence of the CSS solution in their top post, and the intention to use this alternative solution instead. I've been assuming "original text is not modified" means (for them) there is some importance to the page content actually being the modified text; e.g. some particular scenario or platform in which a cut-n-paste or other action would continue to get the original non-CSS-transformed text instead of the intended modification to the text.

User avatar
EA117
Registered User
Posts: 604
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: BBcode ucase -- Lowercase to Uppercase

Post by EA117 » Fri May 17, 2019 12:46 pm

picaron wrote:
Mon May 13, 2019 9:50 pm
The use of CSS is discarded because, with this method, the original text is not modified.
For the record, what is the scenario in which the CSS solution was not sufficient?

picaron
Registered User
Posts: 118
Joined: Wed Apr 05, 2006 8:55 am
Location: Spain

Re: BBcode ucase -- Lowercase to Uppercase

Post by picaron » Fri May 17, 2019 4:44 pm

3Di wrote:
Fri May 17, 2019 5:48 am
You should first try without an editor (WYSIWYG or similars.. like ckeditor or so on).
Once you are done with native core code then you can try to port the desired behaviour to your extensions. ;)

Moreover..

Line breaks? You mean linefeeds?
Accented vowels? You mean UTF-8 Character Encoding?
I'm sorry 3DI, I do not fully understand your comments.

It is not an extension, it is a BBcode.
The line breaks to which I refer are clear in the image of my previous answer.
Initially, the accents in the vowels are solved with "postFilter = mb_strtolower".
Thank you.
My extensions: Anti Adblock, PayForLink, SlideWeUni, StoreToMega, SearchBack, ShowSnow, No DEA Emails.

picaron
Registered User
Posts: 118
Joined: Wed Apr 05, 2006 8:55 am
Location: Spain

Re: BBcode ucase -- Lowercase to Uppercase

Post by picaron » Fri May 17, 2019 5:13 pm

First of all, I want to apologize because my English is very limited.

My BBcode is a tool, more than a BBcode itself. In fact, the BBcode should never be used within a message.
Why?
The purpose of my BBcode is to use it when a user is writing a message and mistakenly press the Caps Lock key.
To prevent the user from having to rewrite all the text, just select the text using the BBcode, preview, select that text and copy it back to the textarea.

In the same way, another purpose would be when we copy the text written by another user and we want to change the typeface.

The option that you propose to me using CSS is not valid for this mission, since when you select a text treated with this CSS, the original untransformed text is actually copied.

I repeat, I do not know if my English allows to transmit the message correctly.

Thanks for your help mrgoldy.
My extensions: Anti Adblock, PayForLink, SlideWeUni, StoreToMega, SearchBack, ShowSnow, No DEA Emails.

Post Reply

Return to “Custom BBCode Development and Requests”

cron