instance method
wrap_emphasis
Ruby on Rails edge
Since edge Private — implementation detail, not part of the public APISignature
wrap_emphasis(text, marker)
Make sure ‘<strong> hello </strong>` becomes ` hello ` and not `** hello **` (the latter is not valid markdown).
Parameters
-
textreq -
markerreq
Source
# File actiontext/lib/action_text/markdown_conversion.rb, line 356
def wrap_emphasis(text, marker)
leading = text[/\A\s*/]
trailing = text[/\s*\z/]
inner = text.strip
"#{leading}#{marker}#{inner}#{marker}#{trailing}"
end
Defined in actiontext/lib/action_text/markdown_conversion.rb line 356
· View on GitHub
· Improve this page
· Find usages on GitHub
Defined in ActionText::MarkdownConversion