Class: TextElements::Preformat

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

Overview

A Preformat element Use: define preformatted text

Instance Method Summary collapse

Constructor Details

#initialize(attrs = {}) ⇒ Preformat

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



299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
# File 'lib/reparcs/elements/text_elements.rb', line 299

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", "input", "ins",
    "kbd", "label", "map", "q", "samp" ,"script", "select", 
    "small", "span", "strong", "sub", "sup", "textarea", "tt", "var"
  ]
  super("pre", aattrs, childs, attrs)
  @start_element = "<pre"
  @end_element = "</pre>"
end