giterlizzi / dokuwiki-plugin-semantic

Dokuwiki Semantic Plugin
http://dokuwiki.org/plugin:semantic
GNU General Public License v2.0
9 stars 5 forks source link

Description element not formatted correctly for schema #12

Closed jcamp closed 6 years ago

jcamp commented 6 years ago

I've looked at this and it seems to take the heading of the page and just the first 250 or 500 characters with \n (line breaks) which do not render well with Google SERP.

I suggest replacing the line breaks with Full Stops (.) and a space character. Which would make things read a lot better. Maybe single line breaks could be converted to a space as well.

Just for interest my code for that is:

public function getDescription() {
return (@$this->meta['description']['abstract'] ? str_replace("\n\n",". ",$this->meta['description']['abstract']): $this->getTitle());
}

image

giterlizzi commented 6 years ago

Hi, Fixed with da1aaf0.

Thanks! Joseph