class Decidim::ContentParsers::NewlineParser
A parser that searches newline escape sequences in content.
The escape sequences `rn` and `r` will be replaced by `n`.
@see BaseParser
Examples of how to use a content parser
Constants
- ESCAPE_SEQUENCES
- REGEX
Public Instance Methods
rewrite()
click to toggle source
@return [String] the content with the escape sequences replaced.
# File lib/decidim/content_parsers/newline_parser.rb, line 15 def rewrite content.gsub(REGEX, "\n") end