Class: TextElements::Code

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

Overview

A code element ” Use: Define computer code text

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Code

Create a new Code element, takes a optional hash of attributes as parameter.



143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# File 'lib/reparcs/elements/text_elements.rb', line 143

def initialize(attrs={})
  aattrs = [
    "class", "id", "title", "dir", "xml:lang",
    "onclick", "ondblclick", "onkeydown", "onkeypress",
    "onkeyup", "onmousedown", "onmousemove", "onmouseout",
    "onmouseover", "onmouseup"
  ]
  childs = [
    "a", "abbr", "acronym", "b", "bdo", "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("code", aattrs, childs, attrs)
  @start_element = "<code"
  @end_element = "</code>"
end