forked from github/markup
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Revert "Revert github#537 temporarily for final 1.4 release"
This reverts commit bbee330.
- Loading branch information
Yuki Izumi
committed
Mar 27, 2017
1 parent
3087f06
commit a970742
Showing
9 changed files
with
54 additions
and
51 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,43 @@ | ||
require "github/markup/markdown" | ||
require "github/markup/rdoc" | ||
require "shellwords" | ||
require "linguist" | ||
|
||
markup_impl(::GitHub::Markups::MARKUP_MARKDOWN, ::GitHub::Markup::Markdown.new) | ||
|
||
markup(::GitHub::Markups::MARKUP_TEXTILE, :redcloth, /textile/) do |content| | ||
markup(::GitHub::Markups::MARKUP_TEXTILE, :redcloth, [Linguist::Language["Textile"]]) do |content| | ||
RedCloth.new(content).to_html | ||
end | ||
|
||
markup_impl(::GitHub::Markups::MARKUP_RDOC, GitHub::Markup::RDoc.new) | ||
|
||
markup(::GitHub::Markups::MARKUP_ORG, 'org-ruby', /org/) do |content| | ||
markup(::GitHub::Markups::MARKUP_ORG, 'org-ruby', [Linguist::Language["Org"]]) do |content| | ||
Orgmode::Parser.new(content, { | ||
:allow_include_files => false, | ||
:skip_syntax_highlight => true | ||
}).to_html | ||
end | ||
|
||
markup(::GitHub::Markups::MARKUP_CREOLE, :creole, /creole/) do |content| | ||
markup(::GitHub::Markups::MARKUP_CREOLE, :creole, [Linguist::Language["Creole"]]) do |content| | ||
Creole.creolize(content) | ||
end | ||
|
||
markup(::GitHub::Markups::MARKUP_MEDIAWIKI, :wikicloth, /mediawiki|wiki/) do |content| | ||
markup(::GitHub::Markups::MARKUP_MEDIAWIKI, :wikicloth, [Linguist::Language["MediaWiki"]]) do |content| | ||
wikicloth = WikiCloth::WikiCloth.new(:data => content) | ||
WikiCloth::WikiBuffer::HTMLElement::ESCAPED_TAGS << 'tt' unless WikiCloth::WikiBuffer::HTMLElement::ESCAPED_TAGS.include?('tt') | ||
wikicloth.to_html(:noedit => true) | ||
end | ||
|
||
markup(::GitHub::Markups::MARKUP_ASCIIDOC, :asciidoctor, /adoc|asc(iidoc)?/) do |content| | ||
markup(::GitHub::Markups::MARKUP_ASCIIDOC, :asciidoctor, [Linguist::Language["AsciiDoc"]]) do |content| | ||
Asciidoctor::Compliance.unique_id_start_index = 1 | ||
Asciidoctor.convert(content, :safe => :secure, :attributes => %w(showtitle=@ idprefix idseparator=- env=github env-github source-highlighter=html-pipeline)) | ||
end | ||
|
||
command( | ||
::GitHub::Markups::MARKUP_RST, | ||
"python2 -S #{Shellwords.escape(File.dirname(__FILE__))}/commands/rest2html", | ||
/re?st(\.txt)?/, | ||
[Linguist::Language["reStructuredText"]], | ||
"restructuredtext" | ||
) | ||
|
||
command(::GitHub::Markups::MARKUP_POD, :pod2html, /pod/, "pod") | ||
command(::GitHub::Markups::MARKUP_POD, :pod2html, [Linguist::Language["Pod"]], "pod") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters