Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How to get text without \n ? #266

Discussion options

Hi,
I'm using the convert method to transform strings like this: "Item 1 - Gift wrapping: Yes&nbsp;<br />" and getting in result strings like this: "Item 1 - Gift wrapping: Yes \n".
Is there a way to get the string without "\n"?

You must be logged in to vote

This example can have multiple interpretations.
What exactly is the goal?

  • remove only trailing whitespace and linebreaks - you can use trimEnd() after conversion;
  • ignore all <br /> tags - use selectors: [ { selector: 'br', format: 'skip' } ].

Replies: 1 comment 1 reply

Comment options

This example can have multiple interpretations.
What exactly is the goal?

  • remove only trailing whitespace and linebreaks - you can use trimEnd() after conversion;
  • ignore all <br /> tags - use selectors: [ { selector: 'br', format: 'skip' } ].
You must be logged in to vote
1 reply
Comment options

I needed to get a result like this: "Item 1 - Gift wrapping: Yes".
trimEnd() helped, thanks.
I just thought there is a build in method for getting the format I needed.

Answer selected by romanboiko-softserve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /