Closed kragit closed 10 years ago
Interesting.. you must not have a space or a line break separating your paragraph tags. Something php's striptags should really take into consideration.
would be wiser to change your regex to this: /(<[^<]+?>)(<[^<]+?>)/
That'll target all html tags vs just the p's. I'll take a look at a few options and update the code. Thanks! :)
I considered changing the regex to that, but I believe that would also introduce spaces after stylistic tags such as b, strong, i, em, etc.
extra spaces won't make a difference on the output. html collapse's all "breaking" spaces into 1 space (vs non-breaking - nbsp)
I misinterpreted what you were saying earlier- with the stylistic tags.
Basically, we would need block type tags to have the space, but inline ones shouldn't. just incase the tag is "mid-word." I think it's a pretty small use case though that one would have that.
Imma look into this today and see what I come up with.. oh php how i love thee
Hey- latest commit: 9a821825922186b4004244e50f34f75150c6e9d4 should fix this up for ya. let me know if any other problems! :)
If a
<p></p>
tag par is stripped from the HTML, the resulting text/sentences are smushed together without a space.turns into
I've negated the issue by adding
preceding the strip_tags line (around line 36 in TrimmerTwigExtension.php), but an actual "fix" would likely be more flexible.