/usr/lib/ruby/vendor_ruby/rdiscount.rb is in ruby-rdiscount 2.1.7.1-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 | # Discount is an implementation of John Gruber's Markdown markup
# language in C. It implements all of the language as described in
# {Markdown Syntax}[http://daringfireball.net/projects/markdown/syntax]
# and passes the Markdown 1.0 test suite. The RDiscount extension makes
# the Discount processor available via a Ruby C Extension library.
#
# == Usage
#
# RDiscount implements the basic protocol popularized by RedCloth and adopted
# by BlueCloth:
# require 'rdiscount'
# markdown = RDiscount.new("Hello World!")
# puts markdown.to_html
#
# == Replacing BlueCloth
#
# Inject RDiscount into your BlueCloth-using code by replacing your bluecloth
# require statements with the following:
# begin
# require 'rdiscount'
# BlueCloth = RDiscount
# rescue LoadError
# require 'bluecloth'
# end
#
class RDiscount
VERSION = '2.1.7'
# Original Markdown formatted text.
attr_reader :text
# Set true to have smarty-like quote translation performed.
attr_accessor :smart
# Do not output <tt><style></tt> tags included in the source text.
attr_accessor :filter_styles
# Do not output any raw HTML included in the source text.
attr_accessor :filter_html
# RedCloth compatible line folding -- not used for Markdown but
# included for compatibility.
attr_accessor :fold_lines
# Enable php markdown extra-style footnotes
attr_accessor :footnotes
# Enable Table Of Contents generation
attr_accessor :generate_toc
# Do not process <tt>![]</tt> and remove <tt><img></tt> tags from the output.
attr_accessor :no_image
# Do not process <tt>[]</tt> and remove <tt><a></tt> tags from the output.
attr_accessor :no_links
# Do not process tables
attr_accessor :no_tables
# Disable superscript and relaxed emphasis processing.
attr_accessor :strict
# Convert URL in links, even if they aren't encased in <tt><></tt>
attr_accessor :autolink
# Don't make hyperlinks from <tt>[][]</tt> links that have unknown URL types.
attr_accessor :safelink
# Do not process pseudo-protocols like <tt>[](id:name)</tt>
attr_accessor :no_pseudo_protocols
# Disable superscript processing.
attr_accessor :no_superscript
# Disable strikethrough processing.
attr_accessor :no_strikethrough
# Create a RDiscount Markdown processor. The +text+ argument
# should be a string containing Markdown text. Additional arguments may be
# supplied to set various processing options:
#
# * <tt>:smart</tt> - Enable SmartyPants processing.
# * <tt>:filter_styles</tt> - Do not output <tt><style></tt> tags.
# * <tt>:filter_html</tt> - Do not output any raw HTML tags included in
# the source text.
# * <tt>:fold_lines</tt> - RedCloth compatible line folding (not used).
# * <tt>:footnotes</tt> - PHP markdown extra-style footnotes.
# * <tt>:generate_toc</tt> - Enable Table Of Contents generation
# * <tt>:no_image</tt> - Do not output any <tt><img></tt> tags.
# * <tt>:no_links</tt> - Do not output any <tt><a></tt> tags.
# * <tt>:no_tables</tt> - Do not output any tables.
# * <tt>:strict</tt> - Disable superscript and relaxed emphasis processing.
# * <tt>:autolink</tt> - Greedily urlify links.
# * <tt>:safelink</tt> - Do not make links for unknown URL types.
# * <tt>:no_pseudo_protocols</tt> - Do not process pseudo-protocols.
# * <tt>:no_superscript</tt> - Disable superscript processing.
# * <tt>:no_strikethrough</tt> - Disable strikethrough processing.
#
def initialize(text, *extensions)
@text = text
extensions.each { |e| send("#{e}=", true) }
end
end
Markdown = RDiscount unless defined? Markdown
require 'rdiscount.so'
|