You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It looks like the gem Redcarpet has tables: false by default
Can you try this changes
in lib/admin_legislation_sanitizer.rb add tr th td table thead tbody
class AdminLegislationSanitizer < WYSIWYGSanitizer
def allowed_tags
super + %w[img h1 h4 h5 h6 tr th td table thead tbody]
end
def allowed_attributes
super + %w[alt src id]
end
end
in app/models/legislation/draft_version.rb add tables: true
def body_html
renderer = Redcarpet::Render::HTML.new(with_toc_data: true)
Redcarpet::Markdown.new(renderer, tables: true).render(body)
end
Description
Type: Bug
Current Behavior
When using the text editor in Collaborative Legislation the markdown for a table renders correctly in the preview part of the text editor.
![image](https://private-user-images.githubusercontent.com/102246590/247118910-4e9b7718-bc50-4672-a67b-5c05e52bd719.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkxNDg3NzIsIm5iZiI6MTcxOTE0ODQ3MiwicGF0aCI6Ii8xMDIyNDY1OTAvMjQ3MTE4OTEwLTRlOWI3NzE4LWJjNTAtNDY3Mi1hNjdiLTVjMDVlNTJiZDcxOS5wbmc_WC1BbXotQWxnb3JpdGhtPUFXUzQtSE1BQy1TSEEyNTYmWC1BbXotQ3JlZGVudGlhbD1BS0lBVkNPRFlMU0E1M1BRSzRaQSUyRjIwMjQwNjIzJTJGdXMtZWFzdC0xJTJGczMlMkZhd3M0X3JlcXVlc3QmWC1BbXotRGF0ZT0yMDI0MDYyM1QxMzE0MzJaJlgtQW16LUV4cGlyZXM9MzAwJlgtQW16LVNpZ25hdHVyZT03ZTdlM2U2MGU5YWIzNDYxMDY0NzYwZWI5ZjdlYTdiNTNjNmU3ZDJlYzEwYzhjY2EwZWNjODE4OWYxNGI3NzdlJlgtQW16LVNpZ25lZEhlYWRlcnM9aG9zdCZhY3Rvcl9pZD0wJmtleV9pZD0wJnJlcG9faWQ9MCJ9.cuNI4hDJOXeKURTREvxzGeW-KRTfcvjKOAh5ZKqFAhU)
When the process is published and viewed in the process the table doesn't render and the markdown commands are shown as text
The opposite behaviour happens with the markdown code for header # It renders correctly in the process but doesn't render in the text editor preview
Expected Behavior
Markdown elements to render consistently
The text was updated successfully, but these errors were encountered: