Skip to content

Instantly share code, notes, and snippets.

@Tyralion
Created August 28, 2018 07:52
Show Gist options
  • Save Tyralion/5983bc7cc444f53cb92257eff612ec78 to your computer and use it in GitHub Desktop.
Save Tyralion/5983bc7cc444f53cb92257eff612ec78 to your computer and use it in GitHub Desktop.
#
# Global conf
#
Ant.config do
tag :p do ->(args, options, content, tags) {
"<p>#{content}</p>"
}
end
end
#
# Local conf
#
new_conf = Ant::Config.new do
tag :p do ->(args, options, content, tags) {
"<local-test>#{content}</local-test>"
}
end
end
# 1
puts Ant.to_html(%{[p]my 'string!\'' [i color="#f00"]red text[/i]}, nil, new_conf)
# 2
puts Ant.to_html(%{[p]my 'string!\'' [i color="#f00"]red text[/i]})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment