36 lines
651 B
Ruby
36 lines
651 B
Ruby
# frozen_string_literal: true
|
|
|
|
module Repubmark
|
|
module Elems
|
|
# TODO: maybe don't allow mdash everywhere
|
|
class Special < Base
|
|
parents :Joint
|
|
|
|
HTML = {
|
|
ellipsis: '…',
|
|
mdash: '—',
|
|
}.freeze
|
|
|
|
GEMTEXT = {
|
|
ellipsis: '…',
|
|
mdash: '—',
|
|
}.freeze
|
|
|
|
def initialize(parent, name)
|
|
super parent
|
|
name = String(name).to_sym.freeze
|
|
HTML.fetch name
|
|
@name = name
|
|
end
|
|
|
|
#################
|
|
# Basic methods #
|
|
#################
|
|
|
|
def to_html = HTML.fetch @name
|
|
|
|
def to_gemtext = GEMTEXT.fetch @name
|
|
end
|
|
end
|
|
end
|