Want to take your software engineering career to the next level? Join the mailing list for career tips & advice Click here


Determines which markup library to use to render a content file (e.g. README) on GitHub

Subscribe to updates I use markup

Statistics on markup

Number of watchers on Github 4210
Number of open issues 74
Average time to close an issue 19 days
Main language Ruby
Average time to merge a PR 23 days
Open pull requests 25+
Closed pull requests 12+
Last commit over 2 years ago
Repo Created almost 11 years ago
Repo Last Updated over 2 years ago
Size 482 KB
Organization / Authorgithub
Latest Releasev2.0.0
Page Updated
Do you use markup? Leave a review!
View open issues (74)
View markup activity
View on github
Fresh, new opensource launches 🚀🚀🚀
Software engineers: It's time to get promoted. Starting NOW! Subscribe to my mailing list and I will equip you with tools, tips and actionable advice to grow in your career.
Evaluating markup for your project? Score Explanation
Commits Score (?)
Issues & PR Score (?)

GitHub Markup

This library is the first step of a journey that every markup file in a repository goes on before it is rendered on GitHub.com:

  1. This library converts the raw markup to HTML. See the list of supported markup formats below.
  2. The HTML is sanitized, aggressively removing things that could harm you and your kinsuch as script tags, inline-styles, and class or id attributes. See the sanitization filter for the full whitelist.
  3. Syntax highlighting is performed on code blocks. See github/linguist for more information about syntax highlighting.
  4. The HTML is passed through other filters in the html-pipeline that add special sauce, such as emoji, task lists, named anchors, CDN caching for images, and autolinking.
  5. The resulting HTML is rendered on GitHub.com.

Please note that only the first step is covered by this gem the rest happens on GitHub.com. In particular, markup itself does no sanitization of the resulting HTML, as it expects that to be covered by whatever pipeline is consuming the HTML.

Please see our contributing guidelines before reporting an issue.


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 -- gem install commonmarker (https://github.com/gjtorikian/commonmarker)
  • .textile -- gem install RedCloth (https://github.com/jgarber/redcloth)
  • .rdoc -- gem install rdoc -v 3.6.1
  • .org -- gem install org-ruby (https://github.com/wallyqs/org-ruby)
  • .creole -- gem install creole (https://github.com/larsch/creole)
  • .mediawiki, .wiki -- gem install wikicloth (https://github.com/nricciar/wikicloth)
  • .rst -- pip install docutils
  • .asciidoc, .adoc, .asc -- gem install asciidoctor (http://asciidoctor.org)
  • .pod -- Pod::Simple::XHTML comes with Perl >= 5.10. Lower versions should install Pod::Simple from CPAN.


gem install github-markup


Basic form:

require 'github/markup'

GitHub::Markup.render('README.markdown', "* One\n* Two")

More realistic form:

require 'github/markup'

GitHub::Markup.render(file, File.read(file))

And a convenience form:

require 'github/markup'

GitHub::Markup.render_s(GitHub::Markups::MARKUP_MARKDOWN, "* One\n* Two")


See Contributing.

markup open issues Ask a question     (View All Issues)
  • over 3 years Wrong tag
  • over 3 years Wrong Marked Language.
  • over 3 years Link to project's root
  • almost 4 years JavaScript/C# tagging confusion
  • almost 4 years Details code block bug
  • almost 4 years RestructuredText (rst): subsequent section and subsection rendered as two sections
  • almost 4 years Images do not render inside tables
  • almost 4 years javascript is detected when c# is the right lang
  • almost 4 years Trbl
  • almost 4 years I think lowercase header field names are breaking badge caching
  • almost 4 years My group project repository is marked as the wrong language
  • almost 4 years Possible bug in text parser?
  • almost 4 years Implement text colors in READMEs
  • almost 4 years Wrong language detected in repository
  • almost 4 years Add support for mdoc (e.g. manpages) markup
  • almost 4 years Bulk checking impossible in nested task list
  • almost 4 years My project code is marked with the incorrect technology (HTML instead of JavaScript)
  • almost 4 years Asciidoc tables of contents don't render
  • almost 4 years Markdown checkboxes aren't clickable in releases.
  • almost 4 years Asciidoc includes don't render
  • almost 4 years Sanitizing HTML not working
  • almost 4 years Non-http URI-s in Markdown
  • almost 4 years Spurious rendering of dates in Github isses
  • almost 4 years No support of README.pdf?
  • almost 4 years Add headerless tables in GFM
  • almost 4 years rendering README.ipynb in a project entrypoint page
  • almost 4 years .rst file not rendered by github; pandoc html conversion does not give errors
  • almost 4 years reStructuredText highlight directive doesn't work
  • almost 4 years Wrong headings hierarchy in reStructuredText
  • almost 4 years Support PlantUML
markup open pull requests (View All Pulls)
  • Mediawiki codepre
  • [WIP] Use Linguist to detect the language
  • Display unknown restructuredText directives
  • Symbol convenience render method
  • Upgrade wikicloth to JRuby-compatible version 0.8.3.
  • Remove creole support
  • bin/github-markup: Follow symlinks to find installation folder.
  • Switch to Pod::Simple::XHTML.
  • Remove compliance setting for now
  • Fix POD markup in test
  • allow multiple files for command line tool
  • Add failing test case
  • Makes rest2html work in both Python2 and Python3
  • Use a more contemporary install command for .rst format.
  • rest2html: Add support for highlight directive
  • rdoc URL updated
  • RestructuredText (rst): Remove the sectsubtitle_xform setting
  • Added support for highlighting doctest blocks in reStructuredText files.
  • Make rest2html work with docutils 0.13
  • (chore) (refactor) pipe result of each gsub instead of modifying original
  • Pass through symlink info
  • Perl POD with file variables line not marked up.
  • Adjust initial_header_level for TOC
  • Remove compliance setting for now
  • [CI] Test against Ruby 2.5
markup questions on Stackoverflow (View All Questions)
  • how extract html markup tags
  • Why is liquid include statement in Tag markup rather than Output markup
  • Why does Twilio Twimlbin reject markup that uses voice="alice"?
  • How to indent a few lines in Markdown markup?
  • Google now Hotel reservation (LodgingReservation) image markup
  • How to change the Markup of a asp.net page serverside (from .cs file)
  • Custom Markup Extension for Data Context Always Treated as type System.Object
  • How Do I Customize the HTML Markup of Images Inserted into WordPress Posts?
  • Where is the best place to put <script> tags in HTML markup?
  • Angular render markup that is nested
  • Extensive pageload time, but minimal markup
  • How to place markup after the submit button in drupal 7?
  • Kendo UI: Extending Button, why is the markup a div?
  • Unable to Export HTML Markup to PDF using iTextSharp API in asp.net using C#?
  • Best markup format for future-proofing large text chunks?
  • Highlight word in HTML text (but not markup)
  • Update markup dynamically after JS Ajax call to CodeBehind static function
  • How to force React to accept server markup
  • Practically speaking, why semantic markup?
  • iOS 9 Search Api - Is it required that using web markup api for public indexing?
  • How can i parse markup text with C#
  • inject context and markup into another template
  • why calling a function within object markup is valid?
  • ASP.NET how does markup access to variables in code-behind?
  • Support RST markup in lektor?
  • html cite, i, etc elements semantic markup
  • Correct Markup for Nested/Grouped Checkbox
  • rails helper - how can I get a helper to give me a `<br/>` (or other markup)
  • Email Markup may not Work I using Amazon SES
  • DOMDocument mangles markup with two sibling elements
markup list of languages used
markup latest release notes
  • Remove filesystem access #1157
  • Updates for Linguist v6 #1139
  • Update to Nokogiri ~> 1.8; drop support for Ruby 2.0 #1156
  • Reverted #537 to avoid extra dependencies
Other projects in Ruby