Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RichText::asText() only include newline when there are multiple blocks? #152

Closed
cloakedninjas opened this issue May 8, 2018 · 0 comments · Fixed by #195
Closed

RichText::asText() only include newline when there are multiple blocks? #152

cloakedninjas opened this issue May 8, 2018 · 0 comments · Fixed by #195
Assignees
Labels

Comments

@cloakedninjas
Copy link

cloakedninjas commented May 8, 2018

I find myself having to strip out \n chars when getting RichText as plaintext and wonder if this could change to only join multiple blocks rather than append a newline to each?

Strip the last newline char, something like:

public static function asText($richText)
{
  
  ...
  
  return substr($result, 0, -1)
}

Or is the a reason why a newline is always appended ?

teohhanhui added a commit to teohhanhui/twig-prismic-extension that referenced this issue Aug 9, 2018
@c0nst4ntin c0nst4ntin self-assigned this Nov 21, 2022
c0nst4ntin added a commit to c0nst4ntin/php-kit that referenced this issue Nov 21, 2022
@c0nst4ntin c0nst4ntin linked a pull request Nov 21, 2022 that will close this issue
c0nst4ntin added a commit to c0nst4ntin/php-kit that referenced this issue Nov 22, 2022
c0nst4ntin added a commit that referenced this issue Nov 22, 2022
…de-newline-when-there-are-multiple-blocks

fix (#152): remove last new line from rich text blocks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
2 participants