5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-05-18 22:20:50 +00:00

usar reverse_markdown para procesar actiontext

This commit is contained in:
f 2019-08-30 17:53:02 -03:00
parent 74ec630377
commit c23fe03303
No known key found for this signature in database
GPG key ID: 2AE5A13E321F953D
4 changed files with 13 additions and 3 deletions

View file

@ -55,6 +55,7 @@ gem 'rails-i18n'
gem 'rails_warden'
gem 'redis', require: %w[redis redis/connection/hiredis]
gem 'redis-rails'
gem 'reverse_markdown', git: 'https://0xacab.org/sutty/reverse_markdown.git'
gem 'rubyzip'
gem 'rugged'
gem 'sidekiq'

View file

@ -1,3 +1,10 @@
GIT
remote: https://0xacab.org/sutty/reverse_markdown.git
revision: 5c243096669aa77e0dc173dec8006b4c5fe07683
specs:
reverse_markdown (1.2.0)
nokogiri
GEM
remote: https://rubygems.org/
specs:
@ -462,6 +469,7 @@ DEPENDENCIES
rbnacl (< 5.0)
redis
redis-rails
reverse_markdown!
rubocop-rails
rubyzip
rugged

View file

@ -10,7 +10,10 @@ class MetadataContent < MetadataTemplate
end
def value
sanitize(self[:value] || document.content || default_value,
markdown = ReverseMarkdown.convert(self[:value]).strip
markdown = nil if markdown.blank?
sanitize(markdown || document.content || default_value,
sanitize_options).tr("\r", '')
end

View file

@ -67,8 +67,6 @@ cada edición se van a degradar los textos sino.
# TODO
* Soportar ~tachado~ en reverse_markdown
* Soportar <figure>
* No escapar los bloques de cita al sanitizar
* Crear plugin que convierta imagenes remotas en locales
* Probar qué otros adjuntos soporta trix y limitarlos (?)