{
    "content": [
        {
            "type": "text",
            "text": "# Rails::Html::WhiteListSanitizer (ri)\n\n## Sections\n\n- **Rails::Html::WhiteListSanitizer < Rails::Html::Sanitizer**\n- **Class methods:**\n- **Instance methods:**\n- **Attributes:**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "Rails::Html::WhiteListSanitizer",
        "section": "",
        "mode": "ri",
        "summary": null,
        "synopsis": null,
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "Rails::Html::WhiteListSanitizer < Rails::Html::Sanitizer",
                "lines": 47,
                "subsections": []
            },
            {
                "name": "Class methods:",
                "lines": 4,
                "subsections": []
            },
            {
                "name": "Instance methods:",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "Attributes:",
                "lines": 3,
                "subsections": []
            }
        ],
        "sections": {
            "Rails::Html::WhiteListSanitizer < Rails::Html::Sanitizer": {
                "content": "(from /home/chedong/.local/share/rdoc)\n------------------------------------------------------------------------\n=== Rails::Html::SafeListSanitizer\nSanitizes html and css from an extensive safe list (see link further\ndown).\n\n=== Whitespace\nWe can't make any guarantees about whitespace being kept or stripped.\nLoofah uses Nokogiri, which wraps either a C or Java parser for the\nrespective Ruby implementation. Those two parsers determine how\nwhitespace is ultimately handled.\n\nWhen the stripped markup will be rendered the users browser won't take\nwhitespace into account anyway. It might be better to suggest your users\nwrap their whitespace sensitive content in pre tags or that you do so\nautomatically.\n\n=== Options\nSanitizes both html and css via the safe lists found here:\nhttps://github.com/flavorjones/loofah/blob/master/lib/loofah/html5/safel\nist.rb\n\nSafeListSanitizer also accepts options to configure the safe list used\nwhen sanitizing html. There's a class level option:\nRails::Html::SafeListSanitizer.allowedtags = %w(table tr td)\nRails::Html::SafeListSanitizer.allowedattributes = %w(id class style)\n\nTags and attributes can also be passed to sanitize. Passed options take\nprecedence over the class level options.\n\n=== Examples\nsafelistsanitizer = Rails::Html::SafeListSanitizer.new\n\nSanitize css doesn't take options\nsafelistsanitizer.sanitizecss('background-color: #000;')\n\nDefault: sanitize via a extensive safe list of allowed elements\nsafelistsanitizer.sanitize(@article.body)\n\nSafe list via the supplied tags and attributes\nsafelistsanitizer.sanitize(@article.body, tags: %w(table tr td),\nattributes: %w(id class style))\n\nSafe list via a custom scrubber\nsafelistsanitizer.sanitize(@article.body, scrubber:\nArticleScrubber.new)\n------------------------------------------------------------------------",
                "subsections": []
            },
            "Class methods:": {
                "content": "allowedattributes\nallowedtags\nnew\n",
                "subsections": []
            },
            "Instance methods:": {
                "content": "sanitize\nsanitizecss\n",
                "subsections": []
            },
            "Attributes:": {
                "content": "attraccessor allowedattributes\nattraccessor allowedtags\n",
                "subsections": []
            }
        }
    }
}