Not worth it.

Get help developing custom BBCodes or request one.
Post Reply
User avatar
david63
Registered User
Posts: 16528
Joined: Thu Dec 19, 2002 8:08 am
Location: Lancashire, UK
Name: David Wood
Contact:

Re: BBcode lcase -- Uppercase to Lowercase

Post by david63 » Tue May 14, 2019 5:37 am

Perhaps it's just me but why would you want such a BBcode? If you want the text in lowercase the surely you would type it in that way and not type it as uppercase and then apply a BBcode. :?
David
Remember: You only know what you know and - you don't know what you don't know!
My CDB Contributions | How to install an extension
I will not be accepting translations for any of my extensions in Github - please post any translations in the appropriate topic.
No support requests via PM or email as they will be ignored

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

Re: BBcode lcase -- Uppercase to Lowercase

Post by EA117 » Tue May 14, 2019 5:58 am

david63 wrote:
Tue May 14, 2019 5:37 am
....surely you would type it in that way...
And if you're not the one who typed the text? We quote things that we didn't type, we code block code we didn't type... surely its not unfathomable the desire to up-case or down-case a list of hashes, a list of IDs, a list of file names, etc., that you're just pasting in and not typing in real time.

Neet trick on the unique ID for the element. I was about to say "but the BBCode can only be used once", and then had to eat my hat. 😜

    User avatar
    mrgoldy
    Jr. Extension Validator
    Posts: 1157
    Joined: Tue Oct 06, 2009 7:34 pm
    Location: The Netherlands
    Name: Gijs
    Contact:

    Re: BBcode lcase -- Uppercase to Lowercase

    Post by mrgoldy » Wed May 15, 2019 5:45 am

    Unfortunately this creates a lot of html elements with the same id. And inserts inline script each time this bbcode is used.

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

    Re: BBcode lcase -- Uppercase to Lowercase

    Post by EA117 » Wed May 15, 2019 9:03 am

    mrgoldy wrote:
    Wed May 15, 2019 5:45 am
    Unfortunately this creates a lot of html elements with the same id. And inserts inline script each time this bbcode is used.
    Do you mind sharing any specifics on what leads to the summarization as "unfortunately?" Wouldn't moving the JavaScript to the end of the page just give us the chance to see the un-transformed text, before then seeing the transformed text, by not transforming it until after the document was completed? And when the duplicate IDs never actually exist within the DOM because the code addresses this point, is there still even an issue there? Thanks.

    User avatar
    mrgoldy
    Jr. Extension Validator
    Posts: 1157
    Joined: Tue Oct 06, 2009 7:34 pm
    Location: The Netherlands
    Name: Gijs
    Contact:

    Re: BBcode lcase -- Uppercase to Lowercase

    Post by mrgoldy » Wed May 15, 2019 3:12 pm

    Okay.
    And what if you try to use this as bbcode:
    [lower]{TEXT;postFilter=strtolower}[/lower]

    With just {TEXT} as HtML replcement.
    Or <xsl:apply-templates/>

    Currently on my phone but something like that should be possible.

    User avatar
    mrgoldy
    Jr. Extension Validator
    Posts: 1157
    Joined: Tue Oct 06, 2009 7:34 pm
    Location: The Netherlands
    Name: Gijs
    Contact:

    Re: BBcode lcase -- Uppercase to Lowercase

    Post by mrgoldy » Wed May 15, 2019 4:45 pm

    I wouldn’t know about the accentuated vowels.
    Not sure what you mean with the line breaks. But you can add a tag rule, like so:
    [lower]{TEXT;postFilter=strtolower #createParagraphs=true}[/lower]
    You can try any of the rules here that could affect it: https://s9etextformatter.readthedocs.io ... Tag_rules/

    User avatar
    mrgoldy
    Jr. Extension Validator
    Posts: 1157
    Joined: Tue Oct 06, 2009 7:34 pm
    Location: The Netherlands
    Name: Gijs
    Contact:

    Re: BBcode ucase -- Lowercase to Uppercase

    Post by mrgoldy » Thu May 16, 2019 2:46 pm

    Could you give me a bit more details on "the line breaks".
    What is expected and what is happening, then I can look into it.

    User avatar
    3Di
    Former Team Member
    Posts: 14202
    Joined: Mon Apr 04, 2005 11:09 pm
    Location: Milan (IT) Frankfurt (DE)
    Name: Marco
    Contact:

    Re: BBcode ucase -- Lowercase to Uppercase

    Post by 3Di » 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?
    Please PM me only to request paid works. Thx.
    Want to compensate me for my interest? Donate
    My development's activity º PhpStorm's proud user
    Extensions, Scripts, MOD porting, Update/Upgrades
    👨‍🏫 | Take a tour to | The Studio | 👨‍🏫

    User avatar
    mrgoldy
    Jr. Extension Validator
    Posts: 1157
    Joined: Tue Oct 06, 2009 7:34 pm
    Location: The Netherlands
    Name: Gijs
    Contact:

    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;
    }

    User avatar
    EA117
    Registered User
    Posts: 899
    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: 899
    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?

    Post Reply

    Return to “Custom BBCode Development and Requests”