# encoding: utf-8 require 'cgi' require 'uri' require 'yaml' require 'unicode_utils/compatibility_decomposition' # :main: TracWiki # The TracWiki parses and translates Trac formatted text into # XHTML. TracWiki is a lightweight markup syntax similar to what many # WikiWikiWebs use. Example syntax: # # = Heading 1 = # == Heading 2 == # === Heading 3 === # **Bold text** # ''Italic text'' # [[Links]] # ||=Table=||=Heading=|| # || Table || Cells || # [[Image(image.png)]] # [[Image(image.png, options)]] # # for more see http://trac.edgewall.org/wiki/WikiFormatting # # You can customize the created image markup by overriding # make_image. # Main TracWiki parser class. Call TracWikiParser#parse to parse # TracWiki formatted text. # # This class is not reentrant. A separate instance is needed for # each thread that needs to convert Creole to HTML. # # Inherit this to provide custom handling of links. The overrideable # methods are: make_local_link module TracWiki class TooLongException < Exception end class Parser # Allowed url schemes # Examples: http https ftp ftps attr_accessor :allowed_schemes # structure where headings are stroed # list of hasheses with `level` and `title`, `sline` # [ { leven: 1, #