Skip to content

Instantly share code, notes, and snippets.

@maxd
Created November 3, 2011 08:10
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 maxd/1336022 to your computer and use it in GitHub Desktop.
Save maxd/1336022 to your computer and use it in GitHub Desktop.
Radius don't handle tags with '-'
require "rubygems"
require "radius"
context = Radius::Context.new do |c|
c.define_tag "a" do |tag|
"'Tag: a'"
end
c.define_tag "a-b" do |tag|
"'Tag: a-b''"
end
end
parser = Radius::Parser.new(context, :tag_prefix => 'x')
result = parser.parse("<x:a>A</x:a> <x:a-b>A-B</x:a-b> <x:a>A</x:a> <x:a-b>A-B</x:a-b>")
puts "Result: #{result}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment