Add tags to allow list and add re-cache button

This commit is contained in:
2023-05-07 12:17:28 +10:00
parent 2de61827a6
commit d94da6c9ca
2 changed files with 3 additions and 1 deletions

View File

@@ -13,7 +13,7 @@ module Admin
bookmark.url
tempfile = Down.download(bookmark.url)
content = Readability::Document.new(tempfile.read, tags: %w[div p h1 h2 h3 h4 h5 h6]).content
content = Readability::Document.new(tempfile.read, tags: %w[div section header p h1 h2 h3 h4 h5 h6 ol ul li table td tr thead tbody a]).content
bookmark_repo.update(id: bookmark_id, cached_content: content)

View File

@@ -18,6 +18,8 @@ div class="max-w-prose mx-auto"
div
- if bookmark.cached_content
a href="/bookmark/#{bookmark.slug}" View cached version
span   —  
button hx-post="/admin/bookmarks/cache/#{bookmark.id}" Re-cache
- else
button hx-post="/admin/bookmarks/cache/#{bookmark.id}" No cached content, cache now?
td