[RFC] Integrate s9e\TextFormatter

These requests for comments/change have lead to an implemented feature that has been successfully merged into the 3.2/Rhea branch. Everything listed in this forum will be available in phpBB 3.2.
Post Reply
User avatar
JoshyPHP
Registered User
Posts: 381
Joined: Fri Jul 08, 2011 9:43 pm

Re: [RFC] Integrate s9e\TextFormatter

Post by JoshyPHP »

You can't create invalid stuff. "_" is a valid character in BBCode names and tag names, you can create [_]{TEXT}[/_] if you want.

BBCodes and tags are normalized to uppercase by default, so if you use the default tag name for the Emoticons plugin you can't create [e] anymore than you can create [E].

Also, I forgot to mention it but tag names can use a prefix like an XML namespace prefix. So if you want to be able to create BBCodes of any names, you can use prefixed tag names for other plugins, e.g. foo:bar for Censor and e:e for Emoticons, and keep unprefixed tag names for BBCodes. Prefixed tag names are not normalized to uppercase, they're case-sensitive.

User avatar
JoshyPHP
Registered User
Posts: 381
Joined: Fri Jul 08, 2011 9:43 pm

Re: [RFC] Integrate s9e\TextFormatter

Post by JoshyPHP »

Just noticed that phpbb\notification\type\quote makes assumptions about post content in the regexp #\[quote="(.+?)"#. That regexp stops working in this PR. The task of retrieving the usernames used in quotes could be moved to phpbb\textformatter\utils::get_quote_usernames(), which would add a dependency to the quote notification.

Alternatively, the regexp could be changed to accomodate the format used in s9e\TextFormatter. Off the top of my head, #<QUOTE(?= )[^>]* author="([^"]+)# would be the best way to retrieve the names used in quotes. #\[quote=(?:"|")(.+?)(?:"|")# would work on both new and legacy, with the same potential for false-positives.

Generally, any service that makes assumptions about a post's content would need to be reviewed and the task should be moved to the text_formatter.utils service.

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: [RFC] Integrate s9e\TextFormatter

Post by EXreaction »

It would be better to use the utilities rather than have the raw regex

aleha
Registered User
Posts: 143
Joined: Tue Mar 26, 2013 2:19 am

Re: [RFC] Integrate s9e\TextFormatter

Post by aleha »

Judging from the reply at the Memory topic, we ain't gonna see this in 3.1?

User avatar
EXreaction
Registered User
Posts: 1555
Joined: Sat Sep 10, 2005 2:15 am

Re: [RFC] Integrate s9e\TextFormatter

Post by EXreaction »

No, this will be going into 3.2.

User avatar
Master_Cylinder
Registered User
Posts: 361
Joined: Wed Jul 31, 2013 9:54 pm

Re: [RFC] Integrate s9e\TextFormatter

Post by Master_Cylinder »

Does the "textformatter" dealio also handle the magic url part of the code as we started discussing here: viewtopic.php?f=108&t=44891 or is that totally separate?
These kids today...
Buy them books, send them to school and what do they do?

They eat the paste. :lol:

User avatar
JoshyPHP
Registered User
Posts: 381
Joined: Fri Jul 08, 2011 9:43 pm

Re: [RFC] Integrate s9e\TextFormatter

Post by JoshyPHP »

It handles magic URLs too, yes. It handles everything that transforms your text such as BBCodes, smilies, etc...

User avatar
Master_Cylinder
Registered User
Posts: 361
Joined: Wed Jul 31, 2013 9:54 pm

Re: [RFC] Integrate s9e\TextFormatter

Post by Master_Cylinder »

OK, I wonder if that RFC that I started should be merged here then? *shrug*
These kids today...
Buy them books, send them to school and what do they do?

They eat the paste. :lol:

User avatar
JoshyPHP
Registered User
Posts: 381
Joined: Fri Jul 08, 2011 9:43 pm

Re: [RFC] Integrate s9e\TextFormatter

Post by JoshyPHP »

No, it's a separate issue so it deserves its separate thread. How links are represented is independent from the backend.

User avatar
naderman
Consultant
Posts: 1727
Joined: Sun Jan 11, 2004 2:11 am
Location: Berlin, Germany
Contact:

Re: [RFC] Integrate s9e\TextFormatter

Post by naderman »

I've only seen your composer.json suggest these extensions but since I haven't seen a clear statement in this topic either, which PHP extensions does s9e/TextFormatter require which will be new phpBB dependencies we do not currently have as requirements?

Post Reply