Class

SM::AttributeManager

Inheritance
< Object

Constants

Name   Description
A_PROTECT = 004 We work by substituting non-printing characters in to the text. For now I‘m assuming that I can substitute a character in the range 0..8 for a 7 bit character without damaging the encoded string, but this might be optimistic
HTML_TAGS = {} This maps HTML tags to the corresponding attribute char
MATCHING_WORD_PAIRS = {} This maps delimiters that occur around words (such as bold or tt) where the start and end delimiters and the same. This lets us optimize the regexp
NULL = "\000".freeze
PROTECTABLE = [ "<" << "\\" ] A \ in front of a character that would normally be processed turns off processing. We do this by turning < into <#{PROTECT}
PROTECT_ATTR = A_PROTECT.chr
SPECIAL = {} And this maps special sequences to a name. A special sequence is something like a WikiWord
WORD_PAIR_MAP = {} And this is used when the delimiters aren‘t the same. In this case the hash maps a pattern to the attribute character

Methods

Class

Visibility Signature
public new ()

Instance

Visibility Signature
public add_html (tag, name)
public add_special (pattern, name)
public add_word_pair (start, stop, name)
public attribute (turn_on, turn_off)
public change_attribute (current, new)
public changed_attribute_by_name (current_set, new_set)
public convert_attrs (str, attrs)
public convert_html (str, attrs)
public convert_specials (str, attrs)
public copy_string (start_pos, end_pos)
public display_attributes ()
public flow (str)
public mask_protected_sequences ()
public split_into_flow ()
public unmask_protected_sequences ()

Class Method Detail

new()

Instance Method Detail

add_html(tag, name)

add_special(pattern, name)

add_word_pair(start, stop, name)

attribute(turn_on, turn_off)

Return an attribute object with the given turn_on and turn_off bits set

change_attribute(current, new)

changed_attribute_by_name(current_set, new_set)

convert_attrs(str, attrs)

Map attributes like textto the sequence \001\002<char>\001\003<char>, where <char> is a per-attribute specific character

convert_html(str, attrs)

convert_specials(str, attrs)

copy_string(start_pos, end_pos)

display_attributes()

flow(str)

mask_protected_sequences()

split_into_flow()

unmask_protected_sequences()