Not worth it.

Get help developing custom BBCodes or request one.
Post Reply
User avatar
david63
Registered User
Posts: 20646
Joined: Thu Dec 19, 2002 8:08 am

Re: BBcode lcase -- Uppercase to Lowercase

Post by david63 »

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!

I now no longer support any of my extensions but they will start to become available here
User avatar
EA117
Registered User
Posts: 2158
Joined: Wed Aug 15, 2018 3:23 am
Contact:

Re: BBcode lcase -- Uppercase to Lowercase

Post by EA117 »

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
    Former Team Member
    Posts: 1394
    Joined: Tue Oct 06, 2009 7:34 pm
    Location: The Netherlands
    Name: Gijs
    Contact:

    Re: BBcode lcase -- Uppercase to Lowercase

    Post by mrgoldy »

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

    Contributing: You can do it too! Including testing Pull Requests (PR).
    phpBB Development and Testing made easy.
    User avatar
    EA117
    Registered User
    Posts: 2158
    Joined: Wed Aug 15, 2018 3:23 am
    Contact:

    Re: BBcode lcase -- Uppercase to Lowercase

    Post by EA117 »

    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
    Former Team Member
    Posts: 1394
    Joined: Tue Oct 06, 2009 7:34 pm
    Location: The Netherlands
    Name: Gijs
    Contact:

    Re: BBcode lcase -- Uppercase to Lowercase

    Post by mrgoldy »

    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.
    phpBB Studio / Member of the Studio

    Contributing: You can do it too! Including testing Pull Requests (PR).
    phpBB Development and Testing made easy.
    User avatar
    mrgoldy
    Former Team Member
    Posts: 1394
    Joined: Tue Oct 06, 2009 7:34 pm
    Location: The Netherlands
    Name: Gijs
    Contact:

    Re: BBcode lcase -- Uppercase to Lowercase

    Post by mrgoldy »

    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/
    phpBB Studio / Member of the Studio

    Contributing: You can do it too! Including testing Pull Requests (PR).
    phpBB Development and Testing made easy.
    User avatar
    mrgoldy
    Former Team Member
    Posts: 1394
    Joined: Tue Oct 06, 2009 7:34 pm
    Location: The Netherlands
    Name: Gijs
    Contact:

    Re: BBcode ucase -- Lowercase to Uppercase

    Post by mrgoldy »

    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.
    phpBB Studio / Member of the Studio

    Contributing: You can do it too! Including testing Pull Requests (PR).
    phpBB Development and Testing made easy.
    User avatar
    3Di
    I've Been Banned!
    Posts: 17538
    Joined: Mon Apr 04, 2005 11:09 pm
    Location: I'm with Ukraine 🇺🇦
    Name: Marco
    Contact:

    Re: BBcode ucase -- Lowercase to Uppercase

    Post by 3Di »

    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?
    🆓 Free support for our extensions also provided here: phpBB Studio
    🚀 Looking for a specific feature or alternative option? We will rock you!
    Please PM me only to request paid works. Thx. Buy me a coffee -> Image
    My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
    User avatar
    mrgoldy
    Former Team Member
    Posts: 1394
    Joined: Tue Oct 06, 2009 7:34 pm
    Location: The Netherlands
    Name: Gijs
    Contact:

    Re: BBcode ucase -- Lowercase to Uppercase

    Post by mrgoldy »

    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 / Member of the Studio

    Contributing: You can do it too! Including testing Pull Requests (PR).
    phpBB Development and Testing made easy.
    User avatar
    EA117
    Registered User
    Posts: 2158
    Joined: Wed Aug 15, 2018 3:23 am
    Contact:

    Re: BBcode ucase -- Lowercase to Uppercase

    Post by EA117 »

    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: 2158
    Joined: Wed Aug 15, 2018 3:23 am
    Contact:

    Re: BBcode ucase -- Lowercase to Uppercase

    Post by EA117 »

    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”