instance method
normalize_line_endings
Ruby on Rails edge
Since edge Private — implementation detail, not part of the public APISignature
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
-
textreq
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