Skip to content
Snippets Groups Projects
Commit 099ab472 authored by Arnaud Levy's avatar Arnaud Levy
Browse files

fix export

parent fa6dd592
No related branches found
No related tags found
No related merge requests found
...@@ -61,12 +61,13 @@ module Admin::ApplicationHelper ...@@ -61,12 +61,13 @@ module Admin::ApplicationHelper
end end
def prepare_for_github(html) def prepare_for_github(html)
text = sanitize html.to_s, text = html.to_s
text = sanitize text,
tags: %w(table a figure img figcaption i em b strong h2 h3 h4 h5 h6 blockquote), tags: %w(table a figure img figcaption i em b strong h2 h3 h4 h5 h6 blockquote),
attributes: %w(href alt title target rel src srcset width height) attributes: %w(href alt title target rel src srcset width height)
text = CGI.escapeHTML text text.gsub! "\r", ''
text = text.strip text.gsub! "\n", ' '
text sanitize text
end end
private private
......
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
title: "<%= @page.title %>" title: "<%= @page.title %>"
permalink: "<%= @page.path %>" permalink: "<%= @page.path %>"
parent: "<%= @page.parent_id %>" parent: "<%= @page.parent_id %>"
description: "<%= prepare_for_github @page.description %>" description: >
text: "<%= prepare_for_github @page.text %>" <%= prepare_for_github @page.description %>
text: >
<%= prepare_for_github @page.text %>
--- ---
<%= @page.content_without_frontmatter.html_safe %> <%= @page.content_without_frontmatter.html_safe %>
...@@ -2,7 +2,9 @@ ...@@ -2,7 +2,9 @@
title: "<%= @post.title %>" title: "<%= @post.title %>"
date: <%= @post.published_at %> UTC date: <%= @post.published_at %> UTC
slug: "<%= @post.slug %>" slug: "<%= @post.slug %>"
description: "<%= prepare_for_github @post.description %>" description: >
text: "<%= prepare_for_github @post.text %>" <%= prepare_for_github @post.description %>
text: >
<%= prepare_for_github @post.text %>
--- ---
<%= @post.content_without_frontmatter.html_safe %> <%= @post.content_without_frontmatter.html_safe %>
...@@ -264,7 +264,7 @@ ActiveRecord::Schema.define(version: 2021_10_21_152728) do ...@@ -264,7 +264,7 @@ ActiveRecord::Schema.define(version: 2021_10_21_152728) do
t.uuid "research_journal_id", null: false t.uuid "research_journal_id", null: false
t.uuid "research_journal_volume_id" t.uuid "research_journal_volume_id"
t.datetime "created_at", precision: 6, null: false t.datetime "created_at", precision: 6, null: false
t.datetime "updated_at", precision: 6, null: false t.date "updated_at", null: false
t.uuid "updated_by_id" t.uuid "updated_by_id"
t.text "abstract" t.text "abstract"
t.text "references" t.text "references"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment