question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Is there some exposed API to call to convert markdown text to rendered html from markdown parser?

See original GitHub issue

I found no revelant API from the docs.

Summary

My website imports tui.editor, and I need render markdown text in a datatable. I found no revelant API from the docs. So I must import another markdown parser, e.g. markdown-it.

// jquery.dataTables
render: function(data, type, row, meta) {
    if (type === 'display') {
       // 'data' is the markdown text
       // How to replace this line with tui.editor?
       let result = markdownit.render(data);
       return result;
     }
     return data;
}},

Screenshots

image

Version

v2.5.0

Additional context

the datatable demo

Thanks for your time!

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

2reactions
seonim-ryucommented, Oct 28, 2020

@taurenshaman Actually, I didn’t understand the question well. As I guessed from the annotation in your code, I understood that you wanted to replace markdown-it with the parser used by TOAST UI Editor.

If it’s right, you can write it like this. Make sure what I understand is correct, and explain in more detail if it is wrong.

import { Parser, createRenderHTML } from '@toast-ui/toastmark';

// ...
// How to replace this line with tui.editor?
// let result = markdownit.render(data);

const parser = new Parser(); // This is the parser used by TOAST UI Editor

const root = parser.parse(content);
const html = createRenderHTML(root);

return html;
0reactions
clichedmoogcommented, Jul 6, 2021

https://codesandbox.io/s/toastmark-forked-botzc?file=/src/index.ts Would anyone help me after this? I thought the variable html would got the rendered HTML but a function.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How To Use Python-Markdown to Convert Markdown Text ...
In this step, you will create a Python program that reads a Markdown file, converts its contents to HTML using the markdown.markdown() function, ......
Read more >
Rendering Markdown with the GitHub Markdown API
I wanted to convert the Markdown used in my TILs to HTML, using the exact same configuration as GitHub does. GitHub has a...
Read more >
Building A Node.js Express API To Convert Markdown To ...
The primary purpose of our API will be to convert text in a Markdown syntax to HTML. The API will have two endpoints:...
Read more >
API get doc as text/html/markdown - Developers Central
Hi @Andreas_Huttenrauch, welcome to the community! Currently the API does not support retrieving text or markdown written in the sections. Only ...
Read more >
VS Code API | Visual Studio Code Extension API
In short, a command is a function with a unique identifier. The function is sometimes also called command handler. Commands can be added...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found