Welcome Guest, Not a member yet? Register   Sign In
Typography
#1

https://github.com/codeigniter4/CodeIgni...graphy.php

Is this really something CI4 should include?
It is not configurable, it only suits the english language and it is a lot of "work" in just the `autoTypography()` method.
To me, it looks like an old class, ported to work with CI4, that's just in there for an absolute edge case. And since one should/would rarely use it, it should not be included in the main CI4 installation

If it stays, it must be configurable. Split `autoTypography()` into multiple methods that can be called independently (and maybe chained).
Why, you ask? Want to have em dashes but no newline formatting? Naa, can't do that.
Want to have curly quotes but as real utf8 characters, not html entities? Sorry mate, can't help you there.

I don't want to insult anyone but it looks like a insufficient (compare with https://github.com/mundschenk-at/php-typography), lazy and slow - and therefore wrong - way of doing those things. CI4 should not encourage working with Text/HTML like that. Especially not, when it's using RegEx to match HTML tags
Reply
#2

You're free to submit pull requests with any changes you'd like to see. Much more effective than simply complaining.

I actually did look at php-typography when porting that over. It's great. And it's pretty large. Yes, I've found simple formatting helpful provided by typography class in CI useful for certain instances. And always been frustrated when I needed something more than nl2br when working in other frameworks, but less robust than php-typography. Luckily it's easy to use either.
Reply
#3

It fits in perfectly with a Blog web site...
What did you Try? What did you Get? What did you Expect?

Joined CodeIgniter Community 2009.  ( Skype: insitfx )
Reply
#4

(01-21-2020, 09:05 AM)InsiteFX Wrote: It fits in perfectly with a Blog web site...
One that only offers it's content in English and only when you really want to have every modification made every time. If you output your blog content (uncached) using this class/method, you're not paying attention to performance. So, as I said, it is only usable in edge cases.
Reply
#5

(01-22-2020, 03:56 AM)fabsn182 Wrote:
(01-21-2020, 09:05 AM)InsiteFX Wrote: It fits in perfectly with a Blog web site...
One that only offers it's content in English and only when you really want to have every modification made every time. If you output your blog content (uncached) using this class/method, you're not paying attention to performance. So, as I said, it is only usable in edge cases.

Why only for english text?

Regarding the performance aspect, the doc is clear on that, you should cache the final result:
Quote:Typographic formatting can be processor intensive, particularly if you have a lot of content being formatted. If you choose to use this function you may want to consider caching your pages.
CodeIgniter 4 tutorials (EN/FR) - https://includebeer.com
/*** NO support in private message - Use the forum! ***/
Reply




Theme © iAndrew 2016 - Forum software by © MyBB