HEX
Server: Apache
System: Linux pdx1-shared-a1-38 6.6.104-grsec-jammy+ #3 SMP Tue Sep 16 00:28:11 UTC 2025 x86_64
User: mmickelson (3396398)
PHP: 8.1.31
Disabled: NONE
Upload Files
File: //usr/share/doc/ruby-redcloth/rdoc/RedCloth/TextileDoc.html
<!DOCTYPE html>

<html>
<head>
<meta charset="UTF-8">

<title>class RedCloth::TextileDoc - RedCloth</title>

<script type="text/javascript">
  var rdoc_rel_prefix = "../";
  var index_rel_prefix = "../";
</script>

<script src="../js/navigation.js" defer></script>
<script src="../js/search.js" defer></script>
<script src="../js/search_index.js" defer></script>
<script src="../js/searcher.js" defer></script>
<script src="../js/darkfish.js" defer></script>

<link href="../css/fonts.css" rel="stylesheet">
<link href="../css/rdoc.css" rel="stylesheet">


<body id="top" role="document" class="class">
<nav role="navigation">
  <div id="project-navigation">
    <div id="home-section" role="region" title="Quick navigation" class="nav-section">
  <h2>
    <a href="../index.html" rel="home">Home</a>
  </h2>

  <div id="table-of-contents-navigation">
    <a href="../table_of_contents.html#pages">Pages</a>
    <a href="../table_of_contents.html#classes">Classes</a>
    <a href="../table_of_contents.html#methods">Methods</a>
  </div>
</div>

    <div id="search-section" role="search" class="project-section initially-hidden">
  <form action="#" method="get" accept-charset="utf-8">
    <div id="search-field-wrapper">
      <input id="search-field" role="combobox" aria-label="Search"
             aria-autocomplete="list" aria-controls="search-results"
             type="text" name="search" placeholder="Search" spellcheck="false"
             title="Type to search, Up and Down to navigate, Enter to load">
    </div>

    <ul id="search-results" aria-label="Search Results"
        aria-busy="false" aria-expanded="false"
        aria-atomic="false" class="initially-hidden"></ul>
  </form>
</div>

  </div>

  

  <div id="class-metadata">
    
    
<div id="parent-class-section" class="nav-section">
  <h3>Parent</h3>

  <p class="link">String
</div>

    
    
    
<!-- Method Quickref -->
<div id="method-list-section" class="nav-section">
  <h3>Methods</h3>

  <ul class="link-list" role="directory">
    <li class="calls-super" ><a href="#method-c-new">::new</a>
    <li ><a href="#method-i-to_html">#to_html</a>
    <li ><a href="#method-i-to_latex">#to_latex</a>
  </ul>
</div>

  </div>
</nav>

<main role="main" aria-labelledby="class-RedCloth::TextileDoc">
  <h1 id="class-RedCloth::TextileDoc" class="class">
    class RedCloth::TextileDoc
  </h1>

  <section class="description">
    
  </section>

  <section id="5Buntitled-5D" class="documentation-section">



    <section class="attribute-method-details" class="method-section">
      <header>
        <h3>Attributes</h3>
      </header>

      <div id="attribute-i-filter_classes" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">filter_classes</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        <p>Accessors for setting security restrictions.</p>

<p>This is a nice thing if you&#39;re using <a href="../RedCloth.html"><code>RedCloth</code></a> for formatting in public places (e.g. Wikis) where you don&#39;t want users to abuse HTML for bad things.</p>

<p>If <code>:filter_html</code> is set, HTML which wasn&#39;t created by the Textile processor will be escaped. Alternatively, if <code>:sanitize_html</code> is set,  HTML can pass through the Textile processor but unauthorized tags and attributes will be removed.</p>

<p>If <code>:filter_styles</code> is set, it will also disable the style markup specifier. (&#39;{color: red}&#39;)</p>

<p>If <code>:filter_classes</code> is set, it will also disable class attributes. (&#39;!(classname)image!&#39;)</p>

<p>If <code>:filter_ids</code> is set, it will also disable id attributes. (&#39;!(classname#id)image!&#39;)</p>
        </div>
      </div>
      <div id="attribute-i-filter_html" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">filter_html</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        <p>Accessors for setting security restrictions.</p>

<p>This is a nice thing if you&#39;re using <a href="../RedCloth.html"><code>RedCloth</code></a> for formatting in public places (e.g. Wikis) where you don&#39;t want users to abuse HTML for bad things.</p>

<p>If <code>:filter_html</code> is set, HTML which wasn&#39;t created by the Textile processor will be escaped. Alternatively, if <code>:sanitize_html</code> is set,  HTML can pass through the Textile processor but unauthorized tags and attributes will be removed.</p>

<p>If <code>:filter_styles</code> is set, it will also disable the style markup specifier. (&#39;{color: red}&#39;)</p>

<p>If <code>:filter_classes</code> is set, it will also disable class attributes. (&#39;!(classname)image!&#39;)</p>

<p>If <code>:filter_ids</code> is set, it will also disable id attributes. (&#39;!(classname#id)image!&#39;)</p>
        </div>
      </div>
      <div id="attribute-i-filter_ids" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">filter_ids</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        <p>Accessors for setting security restrictions.</p>

<p>This is a nice thing if you&#39;re using <a href="../RedCloth.html"><code>RedCloth</code></a> for formatting in public places (e.g. Wikis) where you don&#39;t want users to abuse HTML for bad things.</p>

<p>If <code>:filter_html</code> is set, HTML which wasn&#39;t created by the Textile processor will be escaped. Alternatively, if <code>:sanitize_html</code> is set,  HTML can pass through the Textile processor but unauthorized tags and attributes will be removed.</p>

<p>If <code>:filter_styles</code> is set, it will also disable the style markup specifier. (&#39;{color: red}&#39;)</p>

<p>If <code>:filter_classes</code> is set, it will also disable class attributes. (&#39;!(classname)image!&#39;)</p>

<p>If <code>:filter_ids</code> is set, it will also disable id attributes. (&#39;!(classname#id)image!&#39;)</p>
        </div>
      </div>
      <div id="attribute-i-filter_styles" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">filter_styles</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        <p>Accessors for setting security restrictions.</p>

<p>This is a nice thing if you&#39;re using <a href="../RedCloth.html"><code>RedCloth</code></a> for formatting in public places (e.g. Wikis) where you don&#39;t want users to abuse HTML for bad things.</p>

<p>If <code>:filter_html</code> is set, HTML which wasn&#39;t created by the Textile processor will be escaped. Alternatively, if <code>:sanitize_html</code> is set,  HTML can pass through the Textile processor but unauthorized tags and attributes will be removed.</p>

<p>If <code>:filter_styles</code> is set, it will also disable the style markup specifier. (&#39;{color: red}&#39;)</p>

<p>If <code>:filter_classes</code> is set, it will also disable class attributes. (&#39;!(classname)image!&#39;)</p>

<p>If <code>:filter_ids</code> is set, it will also disable id attributes. (&#39;!(classname#id)image!&#39;)</p>
        </div>
      </div>
      <div id="attribute-i-hard_breaks" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">hard_breaks</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        <p>Deprecated accessor for toggling hard breaks.</p>

<p>Traditional <a href="../RedCloth.html"><code>RedCloth</code></a> converted single newlines to HTML break tags, but later versions required <code>:hard_breaks</code> be set to enable this behavior. <code>:hard_breaks</code> is once again the default.</p>
        </div>
      </div>
      <div id="attribute-i-lite_mode" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">lite_mode</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        <p>Accessor for toggling lite mode.</p>

<p>In lite mode, block-level rules are ignored.  This means that tables, paragraphs, lists, and such aren&#39;t available. Only the inline markup for bold, italics, entities and so on.</p>

<pre class="ruby"><span class="ruby-identifier">r</span> = <span class="ruby-constant">RedCloth</span>.<span class="ruby-identifier">new</span>( <span class="ruby-string">&quot;And then? She *fell*!&quot;</span>, [<span class="ruby-value">:lite_mode</span>] )
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">to_html</span>
<span class="ruby-comment">#=&gt; &quot;And then? She &lt;strong&gt;fell&lt;/strong&gt;!&quot;</span>
</pre>
        </div>
      </div>
      <div id="attribute-i-no_span_caps" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">no_span_caps</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        <p>Accessor for toggling span caps.</p>

<p>Textile places `span&#39; tags around capitalized words by default, but this wreaks havoc on Wikis. If <code>:no_span_caps</code> is set, this will be suppressed.</p>
        </div>
      </div>
      <div id="attribute-i-sanitize_html" class="method-detail">
        <div class="method-heading attribute-method-heading">
          <span class="method-name">sanitize_html</span><span
            class="attribute-access-type">[RW]</span>
        </div>

        <div class="method-description">
        <p>Accessors for setting security restrictions.</p>

<p>This is a nice thing if you&#39;re using <a href="../RedCloth.html"><code>RedCloth</code></a> for formatting in public places (e.g. Wikis) where you don&#39;t want users to abuse HTML for bad things.</p>

<p>If <code>:filter_html</code> is set, HTML which wasn&#39;t created by the Textile processor will be escaped. Alternatively, if <code>:sanitize_html</code> is set,  HTML can pass through the Textile processor but unauthorized tags and attributes will be removed.</p>

<p>If <code>:filter_styles</code> is set, it will also disable the style markup specifier. (&#39;{color: red}&#39;)</p>

<p>If <code>:filter_classes</code> is set, it will also disable class attributes. (&#39;!(classname)image!&#39;)</p>

<p>If <code>:filter_ids</code> is set, it will also disable id attributes. (&#39;!(classname#id)image!&#39;)</p>
        </div>
      </div>
    </section>


     <section id="public-class-5Buntitled-5D-method-details" class="method-section">
       <header>
         <h3>Public Class Methods</h3>
       </header>

      <div id="method-c-new" class="method-detail ">
        <div class="method-heading">
          <span class="method-name">new</span><span
            class="method-args">( string, restrictions = [] )</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>

        <div class="method-description">
          <p>Returns a new <a href="../RedCloth.html"><code>RedCloth</code></a> object, based on <em>string</em>, observing  any <em>restrictions</em> specified.</p>

<pre class="ruby"><span class="ruby-identifier">r</span> = <span class="ruby-constant">RedCloth</span>.<span class="ruby-identifier">new</span>( <span class="ruby-string">&quot;h1. A *bold* man&quot;</span> )
  <span class="ruby-comment">#=&gt; &quot;h1. A *bold* man&quot;</span>
<span class="ruby-identifier">r</span>.<span class="ruby-identifier">to_html</span>
  <span class="ruby-comment">#=&gt;&quot;&lt;h1&gt;A &lt;b&gt;bold&lt;/b&gt; man&lt;/h1&gt;&quot;</span>
</pre>
            <div class="method-calls-super">
              Calls superclass method
              
            </div>

          <div class="method-source-code" id="new-source">
            <pre>   <span class="ruby-comment"># File lib/redcloth/textile_doc.rb</span>
<span class="line-num">67</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">initialize</span>( <span class="ruby-identifier">string</span>, <span class="ruby-identifier">restrictions</span> = [] )
<span class="line-num">68</span>   <span class="ruby-identifier">restrictions</span>.<span class="ruby-identifier">each</span> { <span class="ruby-operator">|</span><span class="ruby-identifier">r</span><span class="ruby-operator">|</span> <span class="ruby-identifier">method</span>(<span class="ruby-node">&quot;#{r}=&quot;</span>).<span class="ruby-identifier">call</span>( <span class="ruby-keyword">true</span> ) }
<span class="line-num">69</span>   <span class="ruby-keyword">super</span>( <span class="ruby-identifier">string</span> )
<span class="line-num">70</span> <span class="ruby-keyword">end</span></pre>
          </div>
        </div>


      </div>

    </section>

     <section id="public-instance-5Buntitled-5D-method-details" class="method-section">
       <header>
         <h3>Public Instance Methods</h3>
       </header>

      <div id="method-i-to_html" class="method-detail ">
        <div class="method-heading">
          <span class="method-name">to_html</span><span
            class="method-args">( *rules )</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>

        <div class="method-description">
          <p>Generates HTML from the Textile contents.</p>

<pre class="ruby"><span class="ruby-constant">RedCloth</span>.<span class="ruby-identifier">new</span>( <span class="ruby-string">&quot;And then? She *fell*!&quot;</span> ).<span class="ruby-identifier">to_html</span>
  <span class="ruby-comment">#=&gt;&quot;&lt;p&gt;And then? She &lt;strong&gt;fell&lt;/strong&gt;!&lt;/p&gt;&quot;</span>
</pre>

          <div class="method-source-code" id="to_html-source">
            <pre>   <span class="ruby-comment"># File lib/redcloth/textile_doc.rb</span>
<span class="line-num">78</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_html</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">rules</span> )
<span class="line-num">79</span>   <span class="ruby-identifier">apply_rules</span>(<span class="ruby-identifier">rules</span>)
<span class="line-num">80</span>   
<span class="line-num">81</span>   <span class="ruby-identifier">to</span>(<span class="ruby-constant">RedCloth</span><span class="ruby-operator">::</span><span class="ruby-constant">Formatters</span><span class="ruby-operator">::</span><span class="ruby-constant">HTML</span>)
<span class="line-num">82</span> <span class="ruby-keyword">end</span></pre>
          </div>
        </div>


      </div>

      <div id="method-i-to_latex" class="method-detail ">
        <div class="method-heading">
          <span class="method-name">to_latex</span><span
            class="method-args">( *rules )</span>
          <span class="method-click-advice">click to toggle source</span>
        </div>

        <div class="method-description">
          <p>Generates LaTeX from the Textile contents.</p>

<pre class="ruby"><span class="ruby-constant">RedCloth</span>.<span class="ruby-identifier">new</span>( <span class="ruby-string">&quot;And then? She *fell*!&quot;</span> ).<span class="ruby-identifier">to_latex</span>
  <span class="ruby-comment">#=&gt; &quot;And then? She \\textbf{fell}!\n\n&quot;</span>
</pre>

          <div class="method-source-code" id="to_latex-source">
            <pre>   <span class="ruby-comment"># File lib/redcloth/textile_doc.rb</span>
<span class="line-num">90</span> <span class="ruby-keyword">def</span> <span class="ruby-identifier ruby-title">to_latex</span>( <span class="ruby-operator">*</span><span class="ruby-identifier">rules</span> )
<span class="line-num">91</span>   <span class="ruby-identifier">apply_rules</span>(<span class="ruby-identifier">rules</span>)
<span class="line-num">92</span>   
<span class="line-num">93</span>   <span class="ruby-identifier">to</span>(<span class="ruby-constant">RedCloth</span><span class="ruby-operator">::</span><span class="ruby-constant">Formatters</span><span class="ruby-operator">::</span><span class="ruby-constant">LATEX</span>)
<span class="line-num">94</span> <span class="ruby-keyword">end</span></pre>
          </div>
        </div>


      </div>

    </section>

  </section>
</main>


<footer id="validator-badges" role="contentinfo">
  <p><a href="https://validator.w3.org/check/referer">Validate</a>
  <p>Generated by <a href="https://ruby.github.io/rdoc/">RDoc</a> 6.3.1.
  <p>Based on <a href="http://deveiate.org/projects/Darkfish-RDoc/">Darkfish</a> by <a href="http://deveiate.org">Michael Granger</a>.
</footer>