5
0
Fork 0
mirror of https://0xacab.org/sutty/sutty synced 2024-11-15 07:51:42 +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 'rails_warden'
gem 'redis', require: %w[redis redis/connection/hiredis] gem 'redis', require: %w[redis redis/connection/hiredis]
gem 'redis-rails' gem 'redis-rails'
gem 'reverse_markdown', git: 'https://0xacab.org/sutty/reverse_markdown.git'
gem 'rubyzip' gem 'rubyzip'
gem 'rugged' gem 'rugged'
gem 'sidekiq' 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 GEM
remote: https://rubygems.org/ remote: https://rubygems.org/
specs: specs:
@ -462,6 +469,7 @@ DEPENDENCIES
rbnacl (< 5.0) rbnacl (< 5.0)
redis redis
redis-rails redis-rails
reverse_markdown!
rubocop-rails rubocop-rails
rubyzip rubyzip
rugged rugged

View file

@ -10,7 +10,10 @@ class MetadataContent < MetadataTemplate
end end
def value 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", '') sanitize_options).tr("\r", '')
end end

View file

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