instance method normalize_line_endings

Ruby on Rails edge

Since edge Private — implementation detail, not part of the public API

Signature

normalize_line_endings(text)

Markdown ends a line at a bare CR, but String#lines and String#split(“\n”) do not, so a CR inside a fence would slip past the indentation #format_list_item and #visit_blockquote add to each line and land outside the block.

Parameters

text req
Source
# File actiontext/lib/action_text/markdown_conversion.rb, line 239
      def normalize_line_endings(text)
        text.gsub(/\r\n?/, "\n")
      end

Defined in actiontext/lib/action_text/markdown_conversion.rb line 239 · View on GitHub · Improve this page · Find usages on GitHub

Defined in ActionText::MarkdownConversion

Type at least 2 characters to search.

Use the arrow keys to navigate results, Enter to open one, Escape to close.

Keyboard shortcuts

/
Focus search
⌘K / Ctrl-K
Command palette
?
This help
Esc
Close