Skip to content

Commit 8596b71

Browse files
committed
used local version of marked.js instead of the cdn to avoid a condition where partial would load before the script #380
1 parent 89ea06c commit 8596b71

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

app/assets/javascripts/rails_admin/custom/parse_markdown.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
$(document).on('rails_admin.dom_ready', function() {
2-
if($('.markdown-input').length && $('.markdown-output').length){
2+
if($('.markdown-input').length && $('.markdown-output').length) {
33
const input = $('.markdown-input')[0]
44
const output = $('.markdown-output')[0]
55
output.innerHTML = marked.parse(input.value)

app/assets/javascripts/rails_admin/custom/vendor/marked.min.js

Lines changed: 6 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
%div{class: 'markdown-output', rows: 10, cols: 64, disabled: true}=form.object.body
2-
= javascript_include_tag "https://cdn.jsdelivr.net/npm/marked/marked.min.js"
1+
%div{class: 'markdown-output', style: 'width: fit-content; border: 1px solid #ccc; border-radius: 4px; padding: 6px 12px', disabled: true}=form.object.body
2+
%p{class: 'markdown-disclaimer'}Disclaimer: Preview may appear differently on final page. Use two returns for line breaks.

0 commit comments

Comments
 (0)