Open Graph - Please make it possible to expand HTML br tag in og:description

Phoca plugins - support for all Phoca plugins except Phoca Gallery plugins
canvon
Phoca Member
Phoca Member
Posts: 10
Joined: 11 Sep 2017, 13:10

Open Graph - Please make it possible to expand HTML br tag in og:description

Post by canvon »

Hi,

when an article contains an HTML br tag to have a hard line break (without starting a new paragraph, so, e.g., there is no additional margin/padding), all facebook / open graph plugins I've tried simply removes the tag, so the line break is replaced by .. nothing. This is suboptimal, as it merges the last word before and the first word after the br tag to a single word, which possibly does not make any sense.

Please replace the br tag by a space, by a real line break (newline character?) or even make it configurable in the plugin options. (e.g., if a line break is not possible, it could in my case make sense to replace the br tag by " / " (space, slash, space) to signalize that a new unit of sense (sorry for my bad english) is starting.)

Regards,
Fabian
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48398
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Open Graph - Please make it possible to expand HTML br tag in og:description

Post by Jan »

Ok, thank you for the info.

Jan
If you find Phoca extensions useful, please support the project
canvon
Phoca Member
Phoca Member
Posts: 10
Joined: 11 Sep 2017, 13:10

Re: Open Graph - Please make it possible to expand HTML br tag in og:description

Post by canvon »

Hi,

minimal fix: https://files.canvon.de/patch/joomla/pl ... n2-br.diff

This at least avoids merging unrelated words. For the site at hand, it'd still be better if it would be configurable to replace with " / ", or if it could simply become an '\n'.

By the way, you seem to be explicitly replacing line breaks with a space. I'm new to this; how would Facebook react to a newline still in the description? As far as I know, when you post something on Facebook, you can have line breaks in your typed text. Is that not allowed for og:description from a website?

Regards,
Fabian
canvon
Phoca Member
Phoca Member
Posts: 10
Joined: 11 Sep 2017, 13:10

Re: Open Graph - Please make it possible to expand HTML br tag in og:description

Post by canvon »

Ok, I've googled and asked people I know, and it does not seem possible to get a line break in the URL preview when sharing on Facebook.
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48398
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Open Graph - Please make it possible to expand HTML br tag in og:description

Post by Jan »

Ok, thank you for the info.

Jan
If you find Phoca extensions useful, please support the project
User avatar
Jan
Phoca Hero
Phoca Hero
Posts: 48398
Joined: 10 Nov 2007, 18:23
Location: Czech Republic
Contact:

Re: Open Graph - Please make it possible to expand HTML br tag in og:description

Post by Jan »

Hi, added in version 3.1.1 (Content Plugin) and 3.0.3 (System Plugin)

https://www.phoca.cz/news/958-phoca-ope ... 3-released

Jan
If you find Phoca extensions useful, please support the project
Post Reply