module PseudoHiki

require('hikiparser/hikiblockparser')

PseudoHikiParser – A converter of texts written in a Hiki-like notation into HTML or other formats.

You may find more detailed information at PseudoHikiParser Wiki

Constants

FILE_MARK
IMAGE_SUFFIX_RE
PROTOCOL
RELATIVE_PATH
ROOT_PATH
VERSION

Public Class Methods

associate_nodes_with_tags(node_tag_table) click to toggle source
# File lib/pseudohiki/inlineparser.rb, line 30
def self.associate_nodes_with_tags(node_tag_table)
  from_head, from_tail, to_head, to_tail = {}, {}, {}, {}

  node_tag_table.each do |node_type, head, tail|
    from_head[head] = node_type
    from_tail[tail] = node_type
    to_head[node_type] = head
    to_tail[node_type] = tail
  end

  return from_head, from_tail, to_head, to_tail
end
compile_token_pat(*token_sets) click to toggle source
# File lib/pseudohiki/inlineparser.rb, line 12
def self.compile_token_pat(*token_sets)
  tokens = token_sets.flatten.uniq.sort do |x, y|
    [y.length, y] <=> [x.length, x]
  end.collect {|token| Regexp.escape(token) }
  Regexp.new(tokens.join("|"))
end
split_into_tokens(str, token_pat) click to toggle source
# File lib/pseudohiki/inlineparser.rb, line 19
def self.split_into_tokens(str, token_pat)
  tokens = []
  while m = token_pat.match(str)
    tokens.push m.pre_match unless m.pre_match.empty?
    tokens.push m[0]
    str = m.post_match
  end
  tokens.push str unless str.empty?
  tokens
end