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
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