 # Public/customizable list of possible elements.
 # For each name in this list that is also present in the input template code,
 # a function with the same name will be added to the compiled template.
-coffeekup.tags = merge_elements 'regular', 'obsolete', 'void', 'obsolete_void'
+coffeekup.tags = merge_elements 'regular', 'obsolete', 'void', 'obsolete_void',
+  'svg'
 
 # Public/customizable list of elements that should be rendered self-closed.
 coffeekup.self_closing = merge_elements 'void', 'obsolete_void'
 
 # This is the basic material from which compiled templates will be formed.
 # It will be manipulated in its string form at the `coffeekup.compile` function
-# to generate the final template function. 
+# to generate the final template function.
 skeleton = (data = {}) ->
   # Whether to generate formatted HTML with indentation and line breaks, or
   # just the natural "faux-minified" output.

  comment = (cmt) ->
    text "<!--#{cmt}-->"
    text '\n' if data.format
  
  coffeescript = (param) ->
    switch typeof param
      # `coffeescript -> alert 'hi'` becomes:

    # Legacy adapters for when CoffeeKup expected data in the `context` attribute.
    simple: coffeekup.render
    meryl: coffeekup.render

    express:
      TemplateError: class extends Error
        constructor: (@message) ->
          Error.call this, @message
          Error.captureStackTrace this, arguments.callee
        name: 'TemplateError'

      compile: (template, data) ->
        # Allows `partial 'foo'` instead of `text @partial 'foo'`.
        data.hardcode ?= {}
        data.hardcode.partial = ->
          text @partial.apply @, arguments

        TemplateError = @TemplateError
        try tpl = coffeekup.compile(template, data)
        catch e then throw new TemplateError "Error compiling #{data.filename}: #{e.message}"

        return ->
          try tpl arguments...
          catch e then throw new TemplateError "Error rendering #{data.filename}: #{e.message}"
