Module: Katalyst::Content::TableHelper
- Included in:
- EditorHelper, FrontendHelper
- Defined in:
- app/helpers/katalyst/content/table_helper.rb
Defined Under Namespace
Classes: TableNormalizer
Instance Method Summary collapse
-
#normalize_content_table(table, heading: true) ⇒ String
Normalize table content and render to an HTML string (un-sanitised).
-
#sanitize_content_table(content) ⇒ ActiveSupport::SafeBuffer
Sanitize table content and render to an HTML string (un-sanitised).
Instance Method Details
#normalize_content_table(table, heading: true) ⇒ String
Normalize table content and render to an HTML string (un-sanitised).
14 15 16 |
# File 'app/helpers/katalyst/content/table_helper.rb', line 14 def normalize_content_table(table, heading: true) TableNormalizer.new(table, heading:).to_html end |
#sanitize_content_table(content) ⇒ ActiveSupport::SafeBuffer
Sanitize table content and render to an HTML string (un-sanitised).
22 23 24 25 26 27 28 29 |
# File 'app/helpers/katalyst/content/table_helper.rb', line 22 def sanitize_content_table(content) sanitizer.sanitize( content, tags: , attributes: content_table_allowed_attributes, scrubber:, ).html_safe # rubocop:disable Rails/OutputSafety end |