Class: HypertextElements::Anchor

Inherits:
ContainerElement
  • Object
show all
Defined in:
lib/reparcs/elements/hypertext_elements.rb

Overview

An anchor element Use: Define an anchor

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Anchor

Create a new Anchor



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/reparcs/elements/hypertext_elements.rb', line 8

def initialize(attrs={})
  aattrs = [
    "class", "id", "title", "dir", "xml:lang",
    "hreflang", "accesskey", "charset", "href",
    "rel", "rev", "tabindex", "type", "coords",
    "shape", "onblur", "onclick", "ondblclick",
    "onfocus", "onkeydown", "onkeypress", "onkeyup",
    "onmousedown", "onmousemove", "onmouseout",
    "onmouseover", "onmouseup"
  ]
  childs = [
    "abbr", "acronym", "b", "big", "br", "button",
    "cite", "code", "del", "dfn", "em", "i", "img",
    "input", "ins", "kbd", "label", "map", "object",
    "q", "samp", "script", "select", "small", "span",
    "strong", "sub", "sup", "textarea", "tt", "var"
  ]
  super("a", aattrs, childs, attrs)
  @start_element = "<a"
  @end_element = "</a>"
end