markup-1.3.3/0000755000076400007640000000000012471013615012051 5ustar pravipravimarkup-1.3.3/HISTORY.md0000644000076400007640000000571512471013615013544 0ustar pravipravi## 1.3.3 (2015-02-17) * Address a slight typo with `POSIX` [#456](https://github.com/github/markup/pull/456) [Full changelog](https://github.com/github/markup/compare/v1.3.2...v1.3.3) ## 1.3.2 (2015-02-17) * RST: Output code instead of tt for inline literals [#370](https://github.com/github/markup/pull/370) * RST: Add IDs to headers so that `.. contents` works with `.. sectnum` [#391](https://github.com/github/markup/pull/391) [Full changelog](https://github.com/github/markup/compare/v1.3.1...v1.3.2) ## 1.3.1 (2014-11-13) * Fix name error when trying to use newer versions of RedCarpet [#387](https://github.com/github/markup/pull/387) [Full changelog](https://github.com/github/markup/compare/v1.3.0...v1.3.1) ## 1.3.0 (2014-09-11) * Extend the field limit for tables to 50 characters for RST [#306](https://github.com/github/markup/pull/306) * Add `.mkdn` as a supported markdown extension [#308](https://github.com/github/markup/pull/308) * Upgrade wikicloth to 0.8.1 [#317](https://github.com/github/markup/pull/317) * Force encoding of posix-spawn output [#338](https://github.com/github/markup/pull/338) * Add `.rmd` as a supported markdown extension [#343](https://github.com/github/markup/pull/343) [Full changelog](https://github.com/github/markup/compare/v1.2.1...v1.3.0) ## 1.2.1 (2014-04-23) * Disable RST warnings [#290](https://github.com/github/markup/pull/290) [Full changelog](https://github.com/github/markup/compare/v1.2.0...v1.2.1) ## 1.1.1 (2014-04-03) * Upgrade to org-ruby 0.9.1 * Set default encoding to UTF-8 for Python 2 ## 1.1.0 (2014-03-10) * Raise GitHub::Markup::CommandError if external command exits with a non-zero status. * Remove support for literate Haskell (see #266) ## 0.5.1 (2010-09-30) * Support relative path links in rdoc ## 0.5.0 (2010-07-07) * Added creole support ## 0.4.0 (2010-04-23) * Removed man page support until it's ready. ## 0.3.3 (2010-03-29) * UTF-8 works with ReST now. ## 0.3.2 (2010-03-25) * Improved test runner * Forgive ReST problems that aren't user errors. ## 0.3.1 (2010-03-22) * Add .rst.txt extension * Fix ASCII encoding error while using print u'\u010c' non-ASCII char and similar. ## 0.3.0 (2010-03-11) * man rendering * `github-markup` command line runner ## 0.2.2 (2010-02-09) * pod fixes from Ricardo Signes ## 0.2.1 (2010-01-25) * ReST fixes from Michael Jones ## 0.2.0 (2010-01-10) * org-mode support ## 0.1.7 (2009-11-17) * Ditch asciidoc2html, call asciidoc directly ## 0.1.6 (2009-11-17) * mdown ## 0.1.5 (2009-11-17) * Actually, if we can't render a thing then don't. Not once, not never. ## 0.1.4 (2009-11-17) * Bugfix: Missing commands return the input (instead of nothing) ## 0.1.3 (2009-11-02) * Strip the INDEX comments from POD ## 0.1.2 (2009-11-02) * Renamed to `github-markup` * Bugfix: POD rendering works now, not just index ## 0.1.1 (2009-11-02) * Added `GitHub::Markup.can_render?` helper. * Bugfix: Actually check file extensions ## 0.1.0 (2009-11-02) * First release markup-1.3.3/CONTRIBUTING.md0000644000076400007640000000532312471013615014305 0ustar pravipravi# Contributing Want to contribute? Great! 1. Fork it. 2. Create a branch (`git checkout -b my_markup`) 3. Commit your changes (`git commit -am "Added Snarkdown"`) 4. Push to the branch (`git push origin my_markup`) 5. Open a [Pull Request][1] 6. Enjoy a refreshing Diet Coke and wait There are two ways to add markups. ### Commands If your markup is in a language other than Ruby, drop a translator script in `lib/github/commands` which accepts input on STDIN and returns HTML on STDOUT. See [rest2html][r2h] for an example. Once your script is in place, edit `lib/github/markups.rb` and tell GitHub Markup about it. Again we look to [rest2html][r2hc] for guidance: command(:rest2html, /re?st(.txt)?/) Here we're telling GitHub Markup of the existence of a `rest2html` command which should be used for any file ending in `rest`, `rst`, `rest.txt` or `rst.txt`. Any regular expression will do. Finally add your [tests](#testing). ### Classes If your markup can be translated using a Ruby library, that's great. Check out `lib/github/markups.rb` for some examples. Let's look at Markdown: markup(:markdown, /md|mkdn?|markdown/) do |content| Markdown.new(content).to_html end We give the `markup` method three bits of information: the name of the file to `require`, a regular expression for extensions to match, and a block to run with unformatted markup which should return HTML. If you need to monkeypatch a RubyGem or something, check out the included RDoc example. Finally add your [tests](#testing). ### Testing To run the tests: $ rake When adding support for a new markup library, create a `README.extension` in `test/markups` along with a `README.extension.html`. As you may imagine, the `README.extension` should be your known input and the `README.extension.html` should be the desired output. Now run the tests: `rake` If nothing complains, congratulations! ## Releasing a new version If you are the current maintainer of this gem: 0. Bump the version number in `lib/github-markup.rb`, adhering to [Semantic Versioning](http://semver.org/) 0. Update `HISTORY.md` 0. Test the latest version on GitHub 0. Build the new version with `rake build` 0. Copy `pkg/github-markup*.gem` to `vendor/cache` in your local checkout of GitHub 0. Update the version for `github-markup` in the `Gemfile` 0. Run `bundle update --local github-markup` 0. Run any relevant tests and test it manually from the browser. 0. Push the new gem release with `rake release`. If you don't have permission to release to rubygems.org, contact one of the existing owners (`gem owners github-markup`) and ask them to add you. [1]: http://github.com/github/markup/pulls [r2h]: lib/github/commands/rest2html [r2hc]: lib/github/markups.rb#L51 markup-1.3.3/github-markup.gemspec0000644000076400007640000000203612471013615016176 0ustar pravipravirequire File.expand_path("../lib/github-markup", __FILE__) Gem::Specification.new do |s| s.name = "github-markup" s.version = GitHub::Markup::VERSION s.summary = "The code GitHub uses to render README.markup" s.description = "This gem is used by GitHub to render any fancy markup such " + "as Markdown, Textile, Org-Mode, etc. Fork it and add your own!" s.authors = ["Chris Wanstrath"] s.email = "chris@ozmm.org" s.homepage = "https://github.com/github/markup" s.license = "MIT" s.files = `git ls-files`.split($\) s.executables = s.files.grep(%r{^bin/}).map{ |f| File.basename(f) } s.test_files = s.files.grep(%r{^(test|spec|features)/}) s.require_paths = %w[lib] s.add_development_dependency 'minitest', '~> 5.4.3' s.add_development_dependency 'html-pipeline', '~> 1.0' s.add_development_dependency 'sanitize', '~> 2.1.0' s.add_development_dependency 'nokogiri', '~> 1.6.1' s.add_development_dependency 'nokogiri-diff', '~> 0.2.0' end markup-1.3.3/LICENSE0000644000076400007640000000203212471013615013053 0ustar pravipraviCopyright (c) 2009 GitHub Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. markup-1.3.3/Gemfile0000644000076400007640000000050212471013615013341 0ustar pravipravisource "http://rubygems.org" gemspec gem "posix-spawn", :platforms => :ruby gem "redcarpet", :platforms => :ruby gem "kramdown", :platforms => :jruby gem "RedCloth" gem "rdoc", "~>3.6" gem "org-ruby", "= 0.9.9" gem "creole", "~>0.3.6" gem "wikicloth", "=0.8.1", :platforms => :ruby gem "asciidoctor", "= 0.1.4" gem "rake"markup-1.3.3/.kick0000644000076400007640000000106212471013615012772 0ustar pravipravi# take control of the growl notifications module GrowlHacks def growl(type, subject, body, *args, &block) case type when Kicker::GROWL_NOTIFICATIONS[:succeeded] puts subject = "Success" body = body.split("\n").last when Kicker::GROWL_NOTIFICATIONS[:failed] subject = "Failure" puts body body = body.split("\n").last else return nil end super(type, subject, body, *args, &block) end end Kicker.send :extend, GrowlHacks # no logging Kicker::Utils.module_eval do def log(message) nil end endmarkup-1.3.3/bin/0000755000076400007640000000000012471013615012621 5ustar pravipravimarkup-1.3.3/bin/github-markup0000755000076400007640000000032412471013615015325 0ustar pravipravi#!/usr/bin/env ruby $LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib" require 'github/markup' if ARGV[0] && File.exists?(file = ARGV[0]) puts GitHub::Markup.render(file) else puts "usage: #$0 FILE" end markup-1.3.3/lib/0000755000076400007640000000000012471013615012617 5ustar pravipravimarkup-1.3.3/lib/github/0000755000076400007640000000000012471013615014101 5ustar pravipravimarkup-1.3.3/lib/github/markup.rb0000644000076400007640000000215212471013615015725 0ustar pravipravirequire "github/markup/command_implementation" require "github/markup/gem_implementation" module GitHub module Markup extend self @@markups = [] def markups @@markups end def preload! markups.each do |markup| markup.load end end def render(filename, content = nil) content ||= File.read(filename) if impl = renderer(filename) impl.render(content) else content end end def markup(file, pattern, opts = {}, &block) markups << GemImplementation.new(pattern, file, &block) end def command(command, regexp, &block) if File.exist?(file = File.dirname(__FILE__) + "/commands/#{command}") command = file end markups << CommandImplementation.new(regexp, command, &block) end def can_render?(filename) !!renderer(filename) end def renderer(filename) markups.find { |impl| impl.match?(filename) } end # Define markups markups_rb = File.dirname(__FILE__) + '/markups.rb' instance_eval File.read(markups_rb), markups_rb end end markup-1.3.3/lib/github/markups.rb0000644000076400007640000000260012471013615016106 0ustar pravipravirequire "github/markup/markdown" require "shellwords" markups << GitHub::Markup::Markdown.new markup(:redcloth, /textile/) do |content| RedCloth.new(content).to_html end markup('github/markup/rdoc', /rdoc/) do |content| GitHub::Markup::RDoc.new(content).to_html end markup('org-ruby', /org/) do |content| Orgmode::Parser.new(content, { :allow_include_files => false, :skip_syntax_highlight => true }).to_html end markup(:creole, /creole/) do |content| Creole.creolize(content) end markup(:wikicloth, /mediawiki|wiki/) do |content| WikiCloth::WikiCloth.new(:data => content).to_html(:noedit => true) end markup(:asciidoctor, /adoc|asc(iidoc)?/) do |content| Asciidoctor.render(content, :safe => :secure, :attributes => %w(showtitle idprefix idseparator=- env=github env-github source-highlighter=html-pipeline)) end command("python2 -S #{Shellwords.escape(File.dirname(__FILE__))}/commands/rest2html", /re?st(\.txt)?/) # pod2html is nice enough to generate a full-on HTML document for us, # so we return the favor by ripping out the good parts. # # Any block passed to `command` will be handed the command's STDOUT for # post processing. command('/usr/bin/env perl -MPod::Simple::HTML -e Pod::Simple::HTML::go', /pod/) do |rendered| if rendered =~ /\s*(.+)\s*/mi $1 end end markup-1.3.3/lib/github/markup/0000755000076400007640000000000012471013615015400 5ustar pravipravimarkup-1.3.3/lib/github/markup/rdoc.rb0000644000076400007640000000061612471013615016657 0ustar pravipravirequire "rdoc" require "rdoc/markup/to_html" module GitHub module Markup class RDoc def initialize(content) @content = content end def to_html if ::RDoc::VERSION.to_i >= 4 h = ::RDoc::Markup::ToHtml.new(::RDoc::Options.new) else h = ::RDoc::Markup::ToHtml.new end h.convert(@content) end end end end markup-1.3.3/lib/github/markup/gem_implementation.rb0000644000076400007640000000076212471013615021607 0ustar pravipravirequire "github/markup/implementation" module GitHub module Markup class GemImplementation < Implementation attr_reader :gem_name, :renderer def initialize(regexp, gem_name, &renderer) super regexp @gem_name = gem_name.to_s @renderer = renderer end def load return if @loaded require gem_name @loaded = true end def render(content) load renderer.call(content) end end end end markup-1.3.3/lib/github/markup/command_implementation.rb0000644000076400007640000000324412471013615022453 0ustar pravipravibegin require "posix-spawn" rescue LoadError require "open3" end require "github/markup/implementation" module GitHub module Markup class CommandError < RuntimeError end class CommandImplementation < Implementation attr_reader :command, :block def initialize(regexp, command, &block) super regexp @command = command.to_s @block = block end def render(content) rendered = execute(command, content) rendered = rendered.to_s.empty? ? content : rendered call_block(rendered, content) end private def call_block(rendered, content) if block && block.arity == 2 block.call(rendered, content) elsif block block.call(rendered) else rendered end end if defined?(POSIX::Spawn) def execute(command, target) spawn = POSIX::Spawn::Child.new(*command, :input => target) if spawn.status.success? sanitize(spawn.out, target.encoding) else raise CommandError.new(spawn.err.strip) end end else def execute(command, target) output = Open3.popen3(*command) do |stdin, stdout, stderr, wait_thr| stdin.puts target stdin.close if wait_thr.value.success? stdout.readlines else raise CommandError.new(stderr.readlines.join('').strip) end end sanitize(output.join(''), target.encoding) end end def sanitize(input, encoding) input.gsub("\r", '').force_encoding(encoding) end end end end markup-1.3.3/lib/github/markup/implementation.rb0000644000076400007640000000101612471013615020750 0ustar pravipravimodule GitHub module Markup class Implementation attr_reader :regexp def initialize(regexp) @regexp = regexp end def load # no-op by default end def render(content) raise NotImplementedError, "subclasses of GitHub::Markup::Implementation must define #render" end def match?(filename) file_ext_regexp =~ filename end private def file_ext_regexp @file_ext_regexp ||= /\.(#{regexp})\z/ end end end end markup-1.3.3/lib/github/markup/markdown.rb0000644000076400007640000000245512471013615017555 0ustar pravipravirequire "github/markup/implementation" module GitHub module Markup class Markdown < Implementation MARKDOWN_GEMS = { "github/markdown" => proc { |content| GitHub::Markdown.render(content) }, "redcarpet" => proc { |content| Redcarpet::Markdown.new(Redcarpet::Render::HTML).render(content) }, "rdiscount" => proc { |content| RDiscount.new(content).to_html }, "maruku" => proc { |content| Maruku.new(content).to_html }, "kramdown" => proc { |content| Kramdown::Document.new(content).to_html }, "bluecloth" => proc { |content| BlueCloth.new(content).to_html }, } def initialize super(/md|rmd|mkdn?|mdwn|mdown|markdown|litcoffee/i) end def load return if @renderer MARKDOWN_GEMS.each do |gem_name, renderer| if try_require(gem_name) @renderer = renderer return end end raise LoadError, "no suitable markdown gem found" end def render(content) load @renderer.call(content) end private def try_require(file) require file true rescue LoadError false end end end end markup-1.3.3/lib/github/commands/0000755000076400007640000000000012471013615015702 5ustar pravipravimarkup-1.3.3/lib/github/commands/rest2html0000755000076400007640000001206512471013615017560 0ustar pravipravi#!/usr/bin/env python """ rest2html - A small wrapper file for parsing ReST files at GitHub. Written in 2008 by Jannis Leidel Brandon Keepers Bryan Veloso Chris Wanstrath Dave Abrahams Garen Torikian Gasper Zejn Michael Jones Sam Whited Tyler Chung Vicent Marti To the extent possible under law, the author(s) have dedicated all copyright and related and neighboring rights to this software to the public domain worldwide. This software is distributed without any warranty. You should have received a copy of the CC0 Public Domain Dedication along with this software. If not, see . """ __author__ = "Jannis Leidel" __license__ = "CC0" __version__ = "0.1" import sys import os # This fixes docutils failing with unicode parameters to CSV-Table. The -S # switch and the following 2 lines can be removed after upgrading to python 3. reload(sys) sys.setdefaultencoding('utf-8') import site try: import locale locale.setlocale(locale.LC_ALL, '') except: pass import codecs from docutils.core import publish_parts from docutils.writers.html4css1 import Writer, HTMLTranslator SETTINGS = { 'cloak_email_addresses': True, 'file_insertion_enabled': False, 'raw_enabled': False, 'strip_comments': True, 'doctitle_xform': True, 'sectsubtitle_xform': True, 'initial_header_level': 2, 'report_level': 5, 'syntax_highlight' : 'none', 'math_output' : 'latex', 'field_name_limit': 50, } class GitHubHTMLTranslator(HTMLTranslator): # removes the
tag wrapped around docs # see also: http://bit.ly/1exfq2h (warning! sourceforge link.) def depart_document(self, node): HTMLTranslator.depart_document(self, node) self.html_body.pop(0) # pop the starting
off self.html_body.pop() # pop the ending
off # technique for visiting sections, without generating additional divs # see also: http://bit.ly/NHtyRx # the a is to support ::contents with ::sectnums: http://git.io/N1yC def visit_section(self, node): id_attribute = node.attributes['ids'][0] self.body.append('\n' % id_attribute) self.section_level += 1 def depart_section(self, node): self.section_level -= 1 def visit_literal_block(self, node): classes = node.attributes['classes'] if len(classes) >= 2 and classes[0] == 'code': language = classes[1] del classes[:] self.body.append(self.starttag(node, 'pre', lang=language)) else: self.body.append(self.starttag(node, 'pre')) # always wrap two-backtick rst inline literals in , not # this also avoids the generation of superfluous tags def visit_literal(self, node): self.body.append(self.starttag(node, 'code', suffix='')) def depart_literal(self, node): self.body.append('') def visit_table(self, node): classes = ' '.join(['docutils', self.settings.table_style]).strip() self.body.append( self.starttag(node, 'table', CLASS=classes)) def depart_table(self, node): self.body.append('\n') def depart_image(self, node): uri = node['uri'] ext = os.path.splitext(uri)[1].lower() # we need to swap RST's use of `object` with `img` tags # see http://git.io/5me3dA if ext == ".svg": # preserve essential attributes atts = {} for attribute, value in node.attributes.items(): # we have no time for empty values if value: if attribute == "uri": atts['src'] = value else: atts[attribute] = value # toss off `object` tag self.body.pop() # add on `img` with attributes self.body.append(self.starttag(node, 'img', **atts)) self.body.append(self.context.pop()) def main(): """ Parses the given ReST file or the redirected string input and returns the HTML body. Usage: rest2html < README.rst rest2html README.rst """ try: text = codecs.open(sys.argv[1], 'r', 'utf-8').read() except IOError: # given filename could not be found return '' except IndexError: # no filename given text = sys.stdin.read() writer = Writer() writer.translator_class = GitHubHTMLTranslator parts = publish_parts(text, writer=writer, settings_overrides=SETTINGS) if 'html_body' in parts: html = parts['html_body'] # publish_parts() in python 2.x return dict values as Unicode type # in py3k Unicode is unavailable and values are of str type if isinstance(html, str): return html else: return html.encode('utf-8') return '' if __name__ == '__main__': sys.stdout.write("%s%s" % (main(), "\n")) sys.stdout.flush() markup-1.3.3/lib/github-markup.rb0000644000076400007640000000012412471013615015720 0ustar pravipravimodule GitHub module Markup VERSION = '1.3.3' Version = VERSION end end markup-1.3.3/test/0000755000076400007640000000000012471013615013030 5ustar pravipravimarkup-1.3.3/test/markups/0000755000076400007640000000000012471013615014512 5ustar pravipravimarkup-1.3.3/test/markups/README.asciidoc0000644000076400007640000000020612471013615017145 0ustar pravipravi= Document Title == First Section * One * Two == Second Section NOTE: Here is some source code. ```ruby puts "Hello, World!" ``` markup-1.3.3/test/markups/README.noformat.html0000644000076400007640000000001312471013615020153 0ustar pravipravi* One * Twomarkup-1.3.3/test/markups/README.noformat0000644000076400007640000000001412471013615017211 0ustar pravipravi* One * Two markup-1.3.3/test/markups/README.rst.txt0000644000076400007640000000101412471013615017013 0ustar pravipraviHeader 1 ======== Example text. Header 2 -------- 1. Blah blah ``code`` blah 2. More ``code``, hooray 3. Somé UTF-8° ============== ========================================================== Travis http://travis-ci.org/tony/pullv Docs http://pullv.rtfd.org API http://pullv.readthedocs.org/en/latest/api.html Issues https://github.com/tony/pullv/issues Source https://github.com/tony/pullv ============== ========================================================== markup-1.3.3/test/markups/README.rdoc0000644000076400007640000000024212471013615016316 0ustar pravipravi* One * Two This is an {absolute link}[http://github.com]. So is this: http://github.com This is a {relative link}[link:rawr.html]. So is this: link:rawr.htmlmarkup-1.3.3/test/markups/README.rst.html0000644000076400007640000000364312471013615017152 0ustar pravipravi

Header 1

Subtitle

Example text.

Table of Contents

Header 2

  1. Blah blah code blah
  2. More code, hooray
  3. Somé UTF-8°

The UTF-8 quote character in this table used to cause python to go boom. Now docutils just silently ignores it.

Travis http://travis-ci.org/tony/pullv
Docs http://pullv.rtfd.org
API http://pullv.readthedocs.org/en/latest/api.html
Issues https://github.com/tony/pullv/issues
Source https://github.com/tony/pullv
Coverity Scan Build Status Coverity Scan Build Status

Field list

123456789 123456789 123456789 123456789 123456789 1:
  Uh-oh! This name is too long!
123456789 123456789 123456789 123456789 1234567890: this is a long name, but no problem!
123456789 12345: this is not so long, but long enough for the default!
123456789 1234: this should work even with the default :)
markup-1.3.3/test/markups/README.creole.html0000644000076400007640000000205412471013615017606 0ustar pravipravi

H1

H2

paragraph of text that will be turned into a paragraph element. It can go over several lines with line breaks, it will be turned into a contiguous paragraph element.

You can force a linebreak in your paragraph text
thusly.

  • a list element
    • sub list element
  • 2nd list element
pre formatted text

$ ls -la
total 56
drwxr-xr-x   6 nferrier users  4096 Jul  5 23:10 .
drwxr-x--- 120 nferrier users 12288 Jul  5 19:36 ..
drwxr-xr-x   2 nferrier users  4096 Jul  5 18:19 bin
-rw-r--r--   1 nferrier users     6 Jul  5 18:19 .gitignore
drwxr-xr-x   4 nferrier users  4096 Jul  5 23:10 .hg
-rw-r--r--   1 nferrier users  1182 Jul  5 18:19 HISTORY.md
-rw-r--r--   1 nferrier users   562 Jul  5 18:19 .kick
drwxr-xr-x   3 nferrier users  4096 Jul  5 18:19 lib
-rw-r--r--   1 nferrier users  1050 Jul  5 18:19 LICENSE
-rw-r--r--   1 nferrier users  1312 Jul  5 18:19 Rakefile
-rw-r--r--   1 nferrier users  3390 Jul  5 18:19 README.md
drwxr-xr-x   3 nferrier users  4096 Jul  5 18:19 test
markup-1.3.3/test/markups/README.creole0000644000076400007640000000177112471013615016650 0ustar pravipravi= H1 = == H2 == paragraph of text that will be turned into a paragraph element. It can go over several lines with line breaks, it will be turned into a contiguous paragraph element. You can force a linebreak in your paragraph text\\thusly. * a list element ** sub list element * 2nd list element {{{ pre formatted text $ ls -la total 56 drwxr-xr-x 6 nferrier users 4096 Jul 5 23:10 . drwxr-x--- 120 nferrier users 12288 Jul 5 19:36 .. drwxr-xr-x 2 nferrier users 4096 Jul 5 18:19 bin -rw-r--r-- 1 nferrier users 6 Jul 5 18:19 .gitignore drwxr-xr-x 4 nferrier users 4096 Jul 5 23:10 .hg -rw-r--r-- 1 nferrier users 1182 Jul 5 18:19 HISTORY.md -rw-r--r-- 1 nferrier users 562 Jul 5 18:19 .kick drwxr-xr-x 3 nferrier users 4096 Jul 5 18:19 lib -rw-r--r-- 1 nferrier users 1050 Jul 5 18:19 LICENSE -rw-r--r-- 1 nferrier users 1312 Jul 5 18:19 Rakefile -rw-r--r-- 1 nferrier users 3390 Jul 5 18:19 README.md drwxr-xr-x 3 nferrier users 4096 Jul 5 18:19 test }}} markup-1.3.3/test/markups/README.pod.html0000644000076400007640000000663512471013615017130 0ustar pravipravi

Matrixy

INTRODUCTION

This is a port of the MATLAB/Octave programming language to Parrot. See the ROADMAP file for more information on the status of this project, and what else needs to be done.

ABOUT

Primary goals are:

=item* Create a working compiler that understands the majority of the MATLAB/Octave programming language.

IMPLEMENTATION

This project is broken into three primary components:

=item* The first is the parser, located in the src/parser/ directory. The parser proper is composed of three source files, grammar.pg which is a Perl6Grammar file, and actions.pm which is the associated actions file written in NQP, and grammar-oper.pm which is the operator precidence parser. In addition, several helper functions used by the parser are located in src/internals.

=item* The second component is the library of builtin functions in the src/builtins/ directory. These functions are, currently, written primarily in PIR. Function names prefixed with an underscore are "private" functions for use with the parser. Other functions should have names which are the same as names for regular MATLAB or Octave functions, since they will be available to the HLL. These are also separated into different namespaces depending on visibility and utility.

=item* A number of library functions are written in M, or mostly M with some inline PIR code in toolbox/.

DEPENDENCIES

Matrixy depends on these dependencies:

Parrot

To get a proper version of Parrot to build Matrixy, you will need to check out and build Parrot from source:

    svn co http://svn.parrot.org/parrot/trunk parrot
    cd parrot
    perl Configure.pl
    make && make test && make install-dev

Parrot-Linear-Algebra

The linear algebra package for Parrot is available separately and provides functionality required by Matrixy. This includes matrix data types and matrix manipulation libraries

BUILDING

Once all dependencies are in place, you can build Matrixy using this sequence of commands:

    perl Configure.pl
    nmake test

TODO

    * Parser
    * Standard Builtins
    * Test against Octave Test Suite.

BUGS

Lots!

CONTACT

If you need to contact the Matrixy team, go to the project home page at:

www.github.com\Whiteknight\matrixy

markup-1.3.3/test/markups/README.rdoc.html0000644000076400007640000000043012471013615017260 0ustar pravipravi
  • One

  • Two

This is an absolute link. So is this: github.com

This is a relative link. So is this: rawr.html

markup-1.3.3/test/markups/README.toc.rst.html0000644000076400007640000000235712471013615017737 0ustar pravipravi

1   Introduction

1.1   What is pycparser?

pycparser is a parser for the C language, written in pure Python. It is a module designed to be easily integrated into applications that need to parse C source code.

1.2   What is it good for?

Anything that needs C code to be parsed. The following are some uses for pycparser, taken from real user reports:

  • C code obfuscator
  • Front-end for various specialized C compilers
  • Static code checker
  • Automatic unit-test discovery
  • Adding specialized extensions to the C language

pycparser is unique in the sense that it's written in pure Python - a very high level language that's easy to experiment with and tweak. To people familiar with Lex and Yacc, pycparser's code will be simple to understand.

markup-1.3.3/test/markups/README.litcoffee0000644000076400007640000000167312471013615017340 0ustar pravipraviLiterate CoffeeScript Test -------------------------- > Taken from https://github.com/jashkenas/coffee-script/blob/master/test/literate.litcoffee comment comment test "basic literate CoffeeScript parsing", -> ok yes now with a... test "broken up indentation", -> ... broken up ... do -> ... nested block. ok yes Code must be separated from text by a blank line. test "code blocks must be preceded by a blank line", -> The next line is part of the text and will not be executed. fail() ok yes Code in `backticks is not parsed` and... test "comments in indented blocks work", -> do -> do -> # Regular comment. ### Block comment. ### ok yes Regular [Markdown](http://example.com/markdown) features, like links and unordered lists, are fine: * I * Am * A * List Tabs work too: test "tabbed code", -> ok yes markup-1.3.3/test/markups/README.litcoffee.html0000644000076400007640000000234512471013615020300 0ustar pravipravi

Literate CoffeeScript Test

Taken from https://github.com/jashkenas/coffee-script/blob/master/test/literate.litcoffee

comment comment

test "basic literate CoffeeScript parsing", ->
  ok yes

now with a...

test "broken up indentation", ->

... broken up ...

  do ->

... nested block.

    ok yes

Code must be separated from text by a blank line.

test "code blocks must be preceded by a blank line", ->

The next line is part of the text and will not be executed. fail()

  ok yes

Code in backticks is not parsed and...

test "comments in indented blocks work", ->
  do ->
    do ->
      # Regular comment.

      ###
        Block comment.
      ###

      ok yes

Regular Markdown features, like links and unordered lists, are fine:

  • I

  • Am

  • A

  • List

Tabs work too:

test "tabbed code", -> ok yes

markup-1.3.3/test/markups/README.pod0000644000076400007640000000446412471013615016163 0ustar pravipravi=head1 Matrixy =head2 INTRODUCTION This is a port of the MATLAB/Octave programming language to Parrot. See the ROADMAP file for more information on the status of this project, and what else needs to be done. =head2 ABOUT Primary goals are: =over 4 =item* Create a working compiler that understands the majority of the MATLAB/Octave programming language. =back =head2 IMPLEMENTATION This project is broken into three primary components: =over 4 =item* The first is the parser, located in the C directory. The parser proper is composed of three source files, F which is a Perl6Grammar file, and F which is the associated actions file written in NQP, and F which is the operator precidence parser. In addition, several helper functions used by the parser are located in C. =item* The second component is the library of builtin functions in the C directory. These functions are, currently, written primarily in PIR. Function names prefixed with an underscore are "private" functions for use with the parser. Other functions should have names which are the same as names for regular MATLAB or Octave functions, since they will be available to the HLL. These are also separated into different namespaces depending on visibility and utility. =item* A number of library functions are written in M, or mostly M with some inline PIR code in C. =back =head2 DEPENDENCIES Matrixy depends on these dependencies: =head3 Parrot To get a proper version of Parrot to build Matrixy, you will need to check out and build Parrot from source: svn co http://svn.parrot.org/parrot/trunk parrot cd parrot perl Configure.pl make && make test && make install-dev =head3 Parrot-Linear-Algebra The linear algebra package for Parrot is available separately and provides functionality required by Matrixy. This includes matrix data types and matrix manipulation libraries =head2 BUILDING Once all dependencies are in place, you can build Matrixy using this sequence of commands: perl Configure.pl nmake test =head2 TODO * Parser * Standard Builtins * Test against Octave Test Suite. =head2 BUGS Lots! =head2 CONTACT If you need to contact the Matrixy team, go to the project home page at: www.github.com\Whiteknight\matrixy markup-1.3.3/test/markups/README.txt.html0000644000076400007640000000001312471013615017145 0ustar pravipravi* One * Twomarkup-1.3.3/test/markups/README.toc.rst0000644000076400007640000000152412471013615016767 0ustar pravipravi.. contents:: :backlinks: none .. sectnum:: Introduction ============ What is pycparser? ------------------ **pycparser** is a parser for the C language, written in pure Python. It is a module designed to be easily integrated into applications that need to parse C source code. What is it good for? -------------------- Anything that needs C code to be parsed. The following are some uses for **pycparser**, taken from real user reports: * C code obfuscator * Front-end for various specialized C compilers * Static code checker * Automatic unit-test discovery * Adding specialized extensions to the C language **pycparser** is unique in the sense that it's written in pure Python - a very high level language that's easy to experiment with and tweak. To people familiar with Lex and Yacc, **pycparser**'s code will be simple to understand. markup-1.3.3/test/markups/README.org0000644000076400007640000001017412471013615016163 0ustar pravipravi#+TITLE: org-ruby #+AUTHOR: Brian Dewey #+EMAIL: bdewey@gmail.com #+DATE: 2009-12-21 #+DESCRIPTION: #+KEYWORDS: #+LANGUAGE: en #+OPTIONS: H:3 num:t toc:nil \n:nil @:t ::t |:t ^:t -:t f:t *:t <:t #+OPTIONS: TeX:t LaTeX:nil skip:nil d:nil todo:nil pri:nil tags:not-in-toc #+EXPORT_EXCLUDE_TAGS: exclude #+STARTUP: showall | Status: | Under Development | | Location: | [[http://github.com/wallyqs/org-ruby]] | | Version: | 0.9.0 | * Description Helpful Ruby routines for parsing orgmode files. The most significant thing this library does today is convert orgmode files to textile. Currently, you cannot do much to customize the conversion. The supplied textile conversion is optimized for extracting "content" from the orgfile as opposed to "metadata." * History ** 2014-02-08: Version 0.9.0 - Let's make sure =#+INCLUDE:= is not supported #+INCLUDE: "./README.txt" src text - And confirm that syntax highlight is supported #+begin_src ruby module GitHub module Markup VERSION = 'test' Version = VERSION end end #+end_src ** 2009-12-30: Version 0.5.1 - Minor enhancement: Recognize lines starting with ":" as examples. - Minor enhancement: Recognize #+BEGIN_SRC as source blocks - Minor enhancement: Add "src" and "example" classes to
 blocks.


** 2009-12-30: Version 0.5.0

   - Parse (but not necessarily *use*) in-buffer settings. The following
     in-buffer settings *are* used:
     - Understand the #+TITLE: directive.
     - Exporting todo keywords (option todo:t)
     - Numbering headlines (option num:t)
     - Skipping text before the first headline (option skip:t)
     - Skipping tables (option |:nil)
     - Custom todo keywords
     - EXPORT_SELECT_TAGS and EXPORT_EXLUDE_TAGS for controlling parts of
       the tree to export
   - Rewrite "file:(blah).org" links to "http:(blah).html" links. This
     makes the inter-links to other org-mode files work.
   - Uses  tags inside table rows that precede table separators.
   - Bugfixes:
     - Headings now have HTML escaped.

** 2009-12-29: Version 0.4.2

   - Got rid of the extraneous newline at the start of code blocks.
   - Everything now shows up in code blocks, even org-mode metadata.
   - Fixed bugs:
     - Regressed smart double quotes with HTML escaping. Added a test
       case and fixed the regression.

** 2009-12-29: Version 0.4.1
   - HTML is now escaped by default
   - org-mode comments will show up in a code block.

** 2009-12-29: Version 0.4

   - The first thing output in HTML gets the class "title"
   - HTML output is now indented
   - Proper support for multi-paragraph list items.

     See? This paragraph is part of the last bullet.
     
   - Fixed bugs:
     - "rake spec" wouldn't work on Linux. Needed "require 'rubygems'".

** 2009-12-27: Version 0.3

   - Uses rubypants to get better typography (smart quotes, elipses, etc...).
   - Fixed bugs:
     - Tables and lists did not get properly closed at the end of file
     - You couldn't do inline formatting inside table cells
     - Characters in PRE blocks were not HTML escaped.
   
** 2009-12-26: Version 0.2

   - Added =to_html= output on the parser.
   - Added support for the full range of inline markup: *bold*,
     /italic/, =code=, ~verbatim~, _underline_, +strikethrough+.
   - Lots of refactoring to make the code more maintainable.

** 2009-12-23: Version 0.1

   - Added support for block code, like this:

     #+BEGIN_EXAMPLE
     def flush!
     @logger.debug "FLUSH ==========> #{@output_type}"
     if (@output_type == :blank) then
       @output << "\n"
     elsif (@buffer.length > 0) then
       if @cancel_modifier then
         @output << "p. " if @output_type == :paragraph
         @cancel_modifier = false
       end
       @output << @paragraph_modifier if (@paragraph_modifier and not sticky_modifier?)
       @output << @buffer.textile_substitution << "\n"
     end
     @buffer = ""
   end
   #+END_EXAMPLE

   - Major code cleanup: Created the =OutputBuffer= class that
     greatly simplified a lot of the messiness of =textile=
     conversion.
   - Added support for line breaks within list items.
markup-1.3.3/test/markups/README.textile0000644000076400007640000000001412471013615017042 0ustar  pravipravi* One
* Two
markup-1.3.3/test/markups/README.rmd0000644000076400007640000000002412471013615016147 0ustar  pravipravi# Title
* One
* Two
markup-1.3.3/test/markups/README.markdown0000644000076400007640000000001412471013615017206 0ustar  pravipravi* One
* Two
markup-1.3.3/test/markups/README.textile.html0000644000076400007640000000004612471013615020012 0ustar  pravipravi
  • One
  • Two
markup-1.3.3/test/markups/README.rmd.html0000644000076400007640000000006412471013615017116 0ustar pravipravi

Title

  • One
  • Two
markup-1.3.3/test/markups/README.txt0000644000076400007640000000001412471013615016203 0ustar pravipravi* One * Two markup-1.3.3/test/markups/README.rst.txt.html0000644000076400007640000000147612471013615017772 0ustar pravipravi

Header 1

Example text.

Header 2

  1. Blah blah code blah
  2. More code, hooray
  3. Somé UTF-8°
Travis http://travis-ci.org/tony/pullv
Docs http://pullv.rtfd.org
API http://pullv.readthedocs.org/en/latest/api.html
Issues https://github.com/tony/pullv/issues
Source https://github.com/tony/pullv
markup-1.3.3/test/markups/README.rst0000644000076400007640000000270612471013615016206 0ustar pravipraviHeader 1 ======== -------- Subtitle -------- Example text. .. contents:: Table of Contents Header 2 -------- 1. Blah blah ``code`` blah 2. More ``code``, hooray 3. Somé UTF-8° The UTF-8 quote character in this table used to cause python to go boom. Now docutils just silently ignores it. .. csv-table:: Things that are Awesome (on a scale of 1-11) :quote: ” Thing,Awesomeness Icecream, 7 Honey Badgers, 10.5 Nickelback, -2 Iron Man, 10 Iron Man 2, 3 Tabular Data, 5 Made up ratings, 11 ============== ========================================================== Travis http://travis-ci.org/tony/pullv Docs http://pullv.rtfd.org API http://pullv.readthedocs.org/en/latest/api.html Issues https://github.com/tony/pullv/issues Source https://github.com/tony/pullv ============== ========================================================== .. image:: https://scan.coverity.com/projects/621/badge.svg :target: https://scan.coverity.com/projects/621 :alt: Coverity Scan Build Status .. image:: https://scan.coverity.com/projects/621/badge.svg :alt: Coverity Scan Build Status Field list ---------- :123456789 123456789 123456789 123456789 123456789 1: Uh-oh! This name is too long! :123456789 123456789 123456789 123456789 1234567890: this is a long name, but no problem! :123456789 12345: this is not so long, but long enough for the default! :123456789 1234: this should work even with the default :) markup-1.3.3/test/markups/README.markdown.html0000644000076400007640000000004412471013615020154 0ustar pravipravi
  • One
  • Two
markup-1.3.3/test/markups/README.org.html0000644000076400007640000001103612471013615017124 0ustar pravipravi

org-ruby

Status: Under Development
Location: http://github.com/wallyqs/org-ruby
Version: 0.9.0

1 Description

Helpful Ruby routines for parsing orgmode files. The most significant thing this library does today is convert orgmode files to textile. Currently, you cannot do much to customize the conversion. The supplied textile conversion is optimized for extracting “content” from the orgfile as opposed to “metadata.”

2 History

2.1 2014-02-08: Version 0.9.0

  • Let’s make sure #+INCLUDE: is not supported
  • And confirm that syntax highlight is supported
module GitHub
  module Markup
    VERSION = 'test'
    Version = VERSION
  end
end

2.2 2009-12-30: Version 0.5.1

  • Minor enhancement: Recognize lines starting with “:” as examples.
  • Minor enhancement: Recognize #+BEGIN_SRC as source blocks
  • Minor enhancement: Add “src” and “example” classes to <pre> blocks.

2.3 2009-12-30: Version 0.5.0

  • Parse (but not necessarily use) in-buffer settings. The following in-buffer settings are used:
    • Understand the #+TITLE: directive.
    • Exporting todo keywords (option todo:t)
    • Numbering headlines (option num:t)
    • Skipping text before the first headline (option skip:t)
    • Skipping tables (option |:nil)
    • Custom todo keywords
    • EXPORT_SELECT_TAGS and EXPORT_EXLUDE_TAGS for controlling parts of the tree to export
  • Rewrite “file:(blah).org” links to “http:(blah).html” links. This makes the inter-links to other org-mode files work.
  • Uses <th> tags inside table rows that precede table separators.
  • Bugfixes:
    • Headings now have HTML escaped.

2.4 2009-12-29: Version 0.4.2

  • Got rid of the extraneous newline at the start of code blocks.
  • Everything now shows up in code blocks, even org-mode metadata.
  • Fixed bugs:
    • Regressed smart double quotes with HTML escaping. Added a test case and fixed the regression.

2.5 2009-12-29: Version 0.4.1

  • HTML is now escaped by default
  • org-mode comments will show up in a code block.

2.6 2009-12-29: Version 0.4

  • The first thing output in HTML gets the class “title”
  • HTML output is now indented
  • Proper support for multi-paragraph list items.

    See? This paragraph is part of the last bullet.

  • Fixed bugs:
    • “rake spec” wouldn’t work on Linux. Needed “require ‘rubygems’”.

2.7 2009-12-27: Version 0.3

  • Uses rubypants to get better typography (smart quotes, elipses, etc…).
  • Fixed bugs:
    • Tables and lists did not get properly closed at the end of file
    • You couldn’t do inline formatting inside table cells
    • Characters in PRE blocks were not HTML escaped.

2.8 2009-12-26: Version 0.2

  • Added to_html output on the parser.
  • Added support for the full range of inline markup: bold, italic, code, verbatim, underline, strikethrough.
  • Lots of refactoring to make the code more maintainable.

2.9 2009-12-23: Version 0.1

  • Added support for block code, like this:
      def flush!
      @logger.debug "FLUSH ==========> #{@output_type}"
      if (@output_type == :blank) then
        @output << "\n"
      elsif (@buffer.length > 0) then
        if @cancel_modifier then
          @output << "p. " if @output_type == :paragraph
          @cancel_modifier = false
        end
        @output << @paragraph_modifier if (@paragraph_modifier and not sticky_modifier?)
        @output << @buffer.textile_substitution << "\n"
      end
      @buffer = ""
    end
        
  • Major code cleanup: Created the OutputBuffer class that greatly simplified a lot of the messiness of textile conversion.
  • Added support for line breaks within list items.
markup-1.3.3/test/markups/README.asciidoc.html0000644000076400007640000000057212471013615020116 0ustar pravipravi

Document Title

First Section

  • One

  • Two

Second Section

Note
Here is some source code.
puts "Hello, World!"
markup-1.3.3/test/fixtures/0000755000076400007640000000000012471013615014701 5ustar pravipravimarkup-1.3.3/test/fixtures/fail.sh0000755000076400007640000000007012471013615016150 0ustar pravipravi#!/usr/bin/env bash echo "failure message">&2 && false markup-1.3.3/test/markup_test.rb0000644000076400007640000000636712471013615015727 0ustar pravipravi# encoding: UTF-8 $LOAD_PATH.unshift File.dirname(__FILE__) + "/../lib" require 'github/markup' require 'minitest/autorun' require 'html/pipeline' require 'nokogiri' require 'nokogiri/diff' def normalize_html(text) text.strip! text.gsub!(/\s\s+/,' ') text.gsub!(/\p{Pi}|\p{Pf}|&quot;/u,'"') text.gsub!("\u2026",'...') text end def assert_html_equal(expected, actual, msg = nil) assertion = Proc.new do expected_doc = Nokogiri::HTML(expected) {|config| config.noblanks} actual_doc = Nokogiri::HTML(actual) {|config| config.noblanks} expected_doc.search('//text()').each {|node| node.content = normalize_html node.content} actual_doc.search('//text()').each {|node| node.content = normalize_html node.content} ignore_changes = {"+" => Regexp.union(/^\s*id=".*"\s*$/), "-" => nil} expected_doc.diff(actual_doc) do |change, node| if change != ' ' && !node.blank? then break unless node.to_html =~ ignore_changes[change] end end end assert(assertion.call, msg) end class MarkupTest < Minitest::Test class MarkupFilter < HTML::Pipeline::Filter def call filename = context[:filename] GitHub::Markup.render(filename, File.read(filename)).strip.force_encoding("utf-8") end end Pipeline = HTML::Pipeline.new [ MarkupFilter, HTML::Pipeline::SanitizationFilter ] Dir['test/markups/README.*'].each do |readme| next if readme =~ /html$/ markup = readme.split('/').last.gsub(/^README\./, '') define_method "test_#{markup}" do skip "Skipping MediaWiki test because wikicloth is currently not compatible with JRuby." if markup == "mediawiki" && RUBY_PLATFORM == "java" source = File.read(readme) expected_file = "#{readme}.html" expected = File.read(expected_file).rstrip actual = Pipeline.to_html(nil, :filename => readme) if source != expected assert(source != actual, "#{markup} did not render anything") end diff = IO.popen("diff -u - #{expected_file}", 'r+') do |f| f.write actual f.close_write f.read end assert_html_equal expected, actual, < e assert_equal "failure message", e.message else fail "an exception was expected but was not raised" end end def test_preserve_markup content = "Noël" assert_equal content.encoding.name, GitHub::Markup.render('Foo.rst', content).encoding.name end end markup-1.3.3/.gitignore0000644000076400007640000000005012471013615014034 0ustar pravipravi*.pyc pkg/ .bundle Gemfile.lock vendor/ markup-1.3.3/Rakefile0000644000076400007640000000054512471013615013522 0ustar pravipravi#!/usr/bin/env rake require "bundler/gem_tasks" require 'rake/testtask' Rake::TestTask.new(:test) do |test| test.libs << 'lib' << 'test' test.pattern = 'test/**/*_test.rb' test.verbose = true end desc "Open an irb session preloaded with this library" task :console do sh "irb -I lib -r bundler/setup -r github/markup" end task :default => :test markup-1.3.3/README.md0000644000076400007640000000732712471013615013341 0ustar pravipraviGitHub Markup ============= We use this library on GitHub when rendering your README or any other rich text file. The generated HTML is then run through filters in the [html-pipeline](https://github.com/jch/html-pipeline) to perform things like [sanitization](#html-sanitization) and [syntax highlighting](https://github.com/jch/html-pipeline/blob/master/lib/html/pipeline/syntax_highlight_filter.rb). Markups ------- The following markups are supported. The dependencies listed are required if you wish to run the library. You can also run `script/bootstrap` to fetch them all. * [.markdown, .mdown, .mkdn, .md](http://daringfireball.net/projects/markdown/) -- `gem install redcarpet` (https://github.com/vmg/redcarpet) * [.textile](http://www.textism.com/tools/textile/) -- `gem install RedCloth` * [.rdoc](http://rdoc.sourceforge.net/) -- `gem install rdoc -v 3.6.1` * [.org](http://orgmode.org/) -- `gem install org-ruby` * [.creole](http://wikicreole.org/) -- `gem install creole` * [.mediawiki, .wiki](http://www.mediawiki.org/wiki/Help:Formatting) -- `gem install wikicloth` * [.rst](http://docutils.sourceforge.net/rst.html) -- `easy_install docutils` * [.asciidoc, .adoc, .asc](http://asciidoc.org/) -- `gem install asciidoctor` (http://asciidoctor.org) * [.pod](http://search.cpan.org/dist/perl/pod/perlpod.pod) -- `Pod::Simple::HTML` comes with Perl >= 5.10. Lower versions should install [Pod::Simple](http://search.cpan.org/~dwheeler/Pod-Simple-3.28/lib/Pod/Simple.pod) from CPAN. Installation ----------- gem install github-markup Usage ----- require 'github/markup' GitHub::Markup.render('README.markdown', "* One\n* Two") Or, more realistically: require 'github/markup' GitHub::Markup.render(file, File.read(file)) Contributing ------------ See [Contributing](CONTRIBUTING.md) HTML sanitization ----------------- HTML rendered by the various markup language processors gets passed through an [HTML sanitization filter](https://github.com/jch/html-pipeline/blob/master/lib/html/pipeline/sanitization_filter.rb) for security reasons. HTML elements not in the whitelist are removed. HTML attributes not in the whitelist are removed from the preserved elements. The following HTML elements, organized by category, are whitelisted: |Type | Elements |------|---------- |Headings | `h1`, `h2`, `h3`, `h4`, `h5`, `h6`, `h7`, `h8` |Prose | `p`, `div`, `blockquote` |Formatted | `pre` | Inline | `b`, `i`, `strong`, `em`, `tt`, `code`, `ins`, `del`, `sup`, `sub`, `kbd`, `samp`, `q`, `var` | Lists | `ol`, `ul`, `li`, `dl`, `dt`, `dd` | Tables | `table`, `thead`, `tbody`, `tfoot`, `tr`, `td`, `th` | Breaks | `br`, `hr` | Ruby (East Asian) | `ruby`, `rt`, `rp` The following attributes, organized by element, are whitelisted: |Element | Attributes |------|---------- | `a` | `href` (`http://`, `https://`, `mailto://`, `github-windows://`, and `github-mac://` URI schemes and relative paths only) | `img` | `src` (`http://` and `https://` URI schemes and relative paths only) | `div` | `itemscope`, `itemtype` | All | `abbr`, `accept`, `accept-charset`, `accesskey`, `action`, `align`, `alt`, `axis`, `border`, `cellpadding`, `cellspacing`, `char`, `charoff`, `charset`, `checked`, `cite`, `clear`, `cols`, `colspan`, `color`, `compact`, `coords`, `datetime`, `dir`, `disabled`, `enctype`, `for`, `frame`, `headers`, `height`, `hreflang`, `hspace`, `ismap`, `label`, `lang`, `longdesc`, `maxlength`, `media`, `method`, `multiple`, `name`, `nohref`, `noshade`, `nowrap`, `prompt`, `readonly`, `rel`, `rev`, `rows`, `rowspan`, `rules`, `scope`, `selected`, `shape`, `size`, `span`, `start`, `summary`, `tabindex`, `target`, `title`, `type`, `usemap`, `valign`, `value`, `vspace`, `width`, `itemprop` Note that the `id` attribute is *not* whitelisted. markup-1.3.3/.travis.yml0000644000076400007640000000023712471013615014164 0ustar pravipravilanguage: ruby before_install: sudo pip install docutils rvm: - 1.9.3 - 2.0.0 - 2.1.1 - jruby-19mode jdk: - oraclejdk8 notifications: email: false markup-1.3.3/script/0000755000076400007640000000000012471013615013355 5ustar pravipravimarkup-1.3.3/script/cibuild0000755000076400007640000000062712471013615014723 0ustar pravipravi#!/bin/bash set -e # GC customizations export RUBY_GC_MALLOC_LIMIT=79000000 export RUBY_HEAP_MIN_SLOTS=800000 export RUBY_HEAP_FREE_MIN=100000 export RUBY_HEAP_SLOTS_INCREMENT=400000 export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 export PATH="/usr/share/rbenv/shims:$PATH" export RBENV_VERSION="1.9.3" # bootstrap gem environment changes echo "Bootstrapping gem environment ..." script/bootstrap --local rake markup-1.3.3/script/bootstrap0000755000076400007640000000012112471013615015312 0ustar pravipravi#!/bin/bash set -e cd $(dirname "$0")/.. bundle install easy_install docutils