That is just the format that the TextFormatter uses. How one stores data is not really makes anything better or worse, the reason why 3.2's BBCode parsing is better is just simply because the features that comes from the new TextFormatter.
[RFC] Integrate s9e\TextFormatter
Re: [RFC] Integrate s9e\TextFormatter
Re: [RFC] Integrate s9e\TextFormatter
Can I use the old parsing format in some way? Maybe there are some settings?
Re: [RFC] Integrate s9e\TextFormatter
No, there's no such setting. Why do you need the old format?
Re: [RFC] Integrate s9e\TextFormatter
Thanks for the answer! I am planning to add a forum to a mobile application and will make api. I would like to work with a more familiar format. Now I am considering 3.1 and 3.2 to determine what is best version to use for my purposes.
- 3Di
- Registered User
- Posts: 951
- Joined: Tue Nov 01, 2005 9:50 pm
- Location: Milano 🇮🇹 Frankfurt 🇩🇪
- Contact:
Re: [RFC] Integrate s9e\TextFormatter
This ticket? https://tracker.phpbb.com/browse/PHPBB3-13802
I think is a great idea. Any news?
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. Want to compensate me for my interest? Donate
My development's activity º PhpStorm's proud user º Extensions, Scripts, MOD porting, Update/Upgrades
Looking for a specific feature or alternative option? We will rock you!
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
Re: [RFC] Integrate s9e\TextFormatter
Having 2 bbcodes - one without and another with the = sign, like that:
And the former isn't parsed but the latter is.
Is that intended or a bug?
[ref]{TEXT}[/ref]
<span style="font-weight: bold;">{TEXT}</span>
[ref={COLOR}]{TEXT}[/ref]
<span style="font-weight: bold; color: {COLOR};">{TEXT}</span>
And the former isn't parsed but the latter is.
Is that intended or a bug?
Re: [RFC] Integrate s9e\TextFormatter
Kind of neither. I discovered that phpBB would allow two custom BBCodes of the same name if exactly one of them used a parameter a good 2 years after finishing the implementation. Since then I haven't really seen any real-world example of such a pair of BBCodes. There's a ticket there: https://tracker.phpbb.com/browse/PHPBB3-14357
I wrote a routine to merge those BBCode definitions during loading but I didn't have any real-world data to test it against so it never went anywhere: https://gist.github.com/JoshyPHP/6d9c2f ... d854dcc542
Maybe this could be implemented as a migration so that the new definition appears in the ACP (replacing the two old definitions) instead of being implicitly merged. Would you be interested in taking point on this?
I wrote a routine to merge those BBCode definitions during loading but I didn't have any real-world data to test it against so it never went anywhere: https://gist.github.com/JoshyPHP/6d9c2f ... d854dcc542
Maybe this could be implemented as a migration so that the new definition appears in the ACP (replacing the two old definitions) instead of being implicitly merged. Would you be interested in taking point on this?
Re: [RFC] Integrate s9e\TextFormatter
I would, although I have no clue where I could be useful (excepting real bbcode definitions and/or testing).
Re: [RFC] Integrate s9e\TextFormatter
You can be useful by handling the PR from start to finish. The best way to handle multiple BBCode definitions with the same name may be to replace them with a definition that covers both use case, and do so as a migration.
So far I've seen two different use cases:
The template for 3.2 wouldn't change but the definitions would need to be merged together as such:
As I recall, that's what I implemented in the Gist I posted above.
In the second case, both the definitions and templates would need to be merged into something like this:
In the template above,
So far I've seen two different use cases:
- The
[url]
BBCode requires a value for the URL but if the user doesn't give one it uses the content of the BBCode. Either way the template is the same. - Your
[ref]
BBCode accepts an optional parameter and uses a different template whether it is present or not.
Code: Select all
[url]{URL}[/url]
Code: Select all
[url={URL}]{TEXT}[/url]
Code: Select all
<a href="{URL}">{TEXT}</a>
Code: Select all
[url={URL;useContent}]{TEXT}[/url]
In the second case, both the definitions and templates would need to be merged into something like this:
Code: Select all
[ref={COLOR;optional}]{TEXT}[/ref]
Code: Select all
<xsl:choose>
<xsl:when test="@*">
<span style="font-weight: bold; color: {COLOR};">{TEXT}</span>
</xsl:when>
<xsl:otherwise>
<span style="font-weight: bold;">{TEXT}</span>
</xsl:otherwise>
</xsl:choose>
@*
is an XPath expression that means "all/any attributes."
Last edited by JoshyPHP on Fri Jan 27, 2017 2:57 am, edited 1 time in total.
Re: [RFC] Integrate s9e\TextFormatter
I see the optional attribute actually works if I put this in the ACP:
It accepts both ways, eg. when I write this:
It gets parsed like
Hence: if no color is given, it uses the default value (in this case: inherit). Of course some conditional statements like de XSL scheme would be more powerful, but I think this would cover most cases where an optional attribute is required.
[ref={COLOR;optional;defaultValue=inherit}]{TEXT}[/ref]
It accepts both ways, eg. when I write this:
Code: Select all
[ref]Test without attr[/ref]
plain text
[ref=#FF0000]Test with red color[/ref]
Code: Select all
<span style="font-weight: bold; color: inherit;">Test without attr</span><br>
plain text<br>
<span style="font-weight: bold; color: #FF0000;">Test with red color</span><br>
Above message may contain errors in grammar, spelling or wrongly chosen words. This is because I'm not a native speaker. My apologies in advance.