Skip to content

Commit

Permalink
Fix markdown_to_html to markdownToHTML
Browse files Browse the repository at this point in the history
  • Loading branch information
vlagrassa committed May 7, 2024
1 parent 9d7e308 commit 7863dc9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,13 @@ <h1 class="h5">
}
},
{"data": "trait_name_caendr"},
{"data": "description_long"},
{
"data": "description_long",
// TODO: Should this be Markdown?
// "render": function(data, type, row) {
// return markdownToHTML(data);
// },
},
{
"data": "Upload Date",
"render": function(data, type, row) {
Expand Down
4 changes: 2 additions & 2 deletions src/modules/site-v2/templates/_scripts/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ function create_node(html) {

// Convert text from Markdown to HTML using Toast UI
// This protects against code injection
function markdown_to_html(text) {
function markdownToHTML(text) {
const editor = new toastui.Editor({
el: document.createElement('div'),
initialValue: text,
Expand Down Expand Up @@ -145,7 +145,7 @@ function flash_message(message, full_msg_link=null, full_msg_body=null) {

// Create as a new DOM node, and insert the desired message as formatted (cleaned) HTML
const node = create_node(raw_html);
node.firstElementChild.innerHTML = markdown_to_html(message);
node.firstElementChild.innerHTML = markdownToHTML(message);

// If both full message fields are provided, add as a link & collapse dropdown
if (full_msg_link && full_msg_body) {
Expand Down

0 comments on commit 7863dc9

Please sign in to comment.