Skip to content

Instantly share code, notes, and snippets.

@khalilovcmd
Last active February 5, 2018 11:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save khalilovcmd/42512dbcc6cc19d508a09f625daedfab to your computer and use it in GitHub Desktop.
Save khalilovcmd/42512dbcc6cc19d508a09f625daedfab to your computer and use it in GitHub Desktop.
document = ::Nokogiri::HTML::fragment(text)
document.search("h1,h2,h3").each do |header|
 header.replace("*#{header.text}*")
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment