Markdown to html javascript

Multi tool use
I actually use TinyMCE (4.8.2) on my application for multiple fields. i automatize fields by json content from JIRA API. BUT... One of the field is already in Markdown from JIRA.
Then i have implemented plugin text_pattern from tinymce to configure the markdown symbol in javascipt. The problem still persist and the text will not changed to html without rewrite the text. I can't find issue, do you ?
function initMCEexact(e) {
tinymce.init({
mode: "exact",
theme: "modern",
plugins: 'textpattern, advlist',
selector: 'textarea',
elements: e,
textpattern_patterns: [
{start: '_', end: '_', format: 'italic'},
{start: '*', end: '*', format: 'bold'},
{start: 'h1. ', format: 'h1'},
{start: 'h2. ', format: 'h2'},
{start: 'h3. ', format: 'h3'},
{start: 'h4. ', format: 'h4'},
{start: 'h5. ', format: 'h5'},
{start: 'h6. ', format: 'h6'},
{start: '# ', cmd: 'InsertOrderedList'},
{start: '* ', cmd: 'InsertUnorderedList'},
{start: '*', cmd: 'InsertUnorderedList'},
{start: '//brb', replacement: 'Be Right Back'}
]
});
}
Expecting translation of markdown to HTML automatically.
javascript html tinymce markdown
New contributor
Fanny Bellais is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I actually use TinyMCE (4.8.2) on my application for multiple fields. i automatize fields by json content from JIRA API. BUT... One of the field is already in Markdown from JIRA.
Then i have implemented plugin text_pattern from tinymce to configure the markdown symbol in javascipt. The problem still persist and the text will not changed to html without rewrite the text. I can't find issue, do you ?
function initMCEexact(e) {
tinymce.init({
mode: "exact",
theme: "modern",
plugins: 'textpattern, advlist',
selector: 'textarea',
elements: e,
textpattern_patterns: [
{start: '_', end: '_', format: 'italic'},
{start: '*', end: '*', format: 'bold'},
{start: 'h1. ', format: 'h1'},
{start: 'h2. ', format: 'h2'},
{start: 'h3. ', format: 'h3'},
{start: 'h4. ', format: 'h4'},
{start: 'h5. ', format: 'h5'},
{start: 'h6. ', format: 'h6'},
{start: '# ', cmd: 'InsertOrderedList'},
{start: '* ', cmd: 'InsertUnorderedList'},
{start: '*', cmd: 'InsertUnorderedList'},
{start: '//brb', replacement: 'Be Right Back'}
]
});
}
Expecting translation of markdown to HTML automatically.
javascript html tinymce markdown
New contributor
Fanny Bellais is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
I actually use TinyMCE (4.8.2) on my application for multiple fields. i automatize fields by json content from JIRA API. BUT... One of the field is already in Markdown from JIRA.
Then i have implemented plugin text_pattern from tinymce to configure the markdown symbol in javascipt. The problem still persist and the text will not changed to html without rewrite the text. I can't find issue, do you ?
function initMCEexact(e) {
tinymce.init({
mode: "exact",
theme: "modern",
plugins: 'textpattern, advlist',
selector: 'textarea',
elements: e,
textpattern_patterns: [
{start: '_', end: '_', format: 'italic'},
{start: '*', end: '*', format: 'bold'},
{start: 'h1. ', format: 'h1'},
{start: 'h2. ', format: 'h2'},
{start: 'h3. ', format: 'h3'},
{start: 'h4. ', format: 'h4'},
{start: 'h5. ', format: 'h5'},
{start: 'h6. ', format: 'h6'},
{start: '# ', cmd: 'InsertOrderedList'},
{start: '* ', cmd: 'InsertUnorderedList'},
{start: '*', cmd: 'InsertUnorderedList'},
{start: '//brb', replacement: 'Be Right Back'}
]
});
}
Expecting translation of markdown to HTML automatically.
javascript html tinymce markdown
New contributor
Fanny Bellais is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
I actually use TinyMCE (4.8.2) on my application for multiple fields. i automatize fields by json content from JIRA API. BUT... One of the field is already in Markdown from JIRA.
Then i have implemented plugin text_pattern from tinymce to configure the markdown symbol in javascipt. The problem still persist and the text will not changed to html without rewrite the text. I can't find issue, do you ?
function initMCEexact(e) {
tinymce.init({
mode: "exact",
theme: "modern",
plugins: 'textpattern, advlist',
selector: 'textarea',
elements: e,
textpattern_patterns: [
{start: '_', end: '_', format: 'italic'},
{start: '*', end: '*', format: 'bold'},
{start: 'h1. ', format: 'h1'},
{start: 'h2. ', format: 'h2'},
{start: 'h3. ', format: 'h3'},
{start: 'h4. ', format: 'h4'},
{start: 'h5. ', format: 'h5'},
{start: 'h6. ', format: 'h6'},
{start: '# ', cmd: 'InsertOrderedList'},
{start: '* ', cmd: 'InsertUnorderedList'},
{start: '*', cmd: 'InsertUnorderedList'},
{start: '//brb', replacement: 'Be Right Back'}
]
});
}
Expecting translation of markdown to HTML automatically.
javascript html tinymce markdown
javascript html tinymce markdown
New contributor
Fanny Bellais is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Fanny Bellais is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Fanny Bellais is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
asked Dec 27 at 13:28


Fanny Bellais
11
11
New contributor
Fanny Bellais is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
Fanny Bellais is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Fanny Bellais is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
It might be better if you use a Markdown to HTML converter. I recommend ShowdownJS. Just add it to your project with <script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.0/showdown.min.js"></script>
, and then use this code:
var converter = new showdown.Converter();
var text = '# hello, markdown!';
var html = converter.makeHtml(text);
New contributor
kyleplo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Hello thanks for you're answer, the library is pretty cool but it's not adapted to my problem. In fact this library is maybe too restrictive...
– Fanny Bellais
Dec 27 at 16:51
the values to change are to restrictive, exemple for the library : # heading and in my case : h1. heading
– Fanny Bellais
Dec 27 at 16:53
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Fanny Bellais is a new contributor. Be nice, and check out our Code of Conduct.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53945888%2fmarkdown-to-html-javascript%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
It might be better if you use a Markdown to HTML converter. I recommend ShowdownJS. Just add it to your project with <script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.0/showdown.min.js"></script>
, and then use this code:
var converter = new showdown.Converter();
var text = '# hello, markdown!';
var html = converter.makeHtml(text);
New contributor
kyleplo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Hello thanks for you're answer, the library is pretty cool but it's not adapted to my problem. In fact this library is maybe too restrictive...
– Fanny Bellais
Dec 27 at 16:51
the values to change are to restrictive, exemple for the library : # heading and in my case : h1. heading
– Fanny Bellais
Dec 27 at 16:53
add a comment |
It might be better if you use a Markdown to HTML converter. I recommend ShowdownJS. Just add it to your project with <script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.0/showdown.min.js"></script>
, and then use this code:
var converter = new showdown.Converter();
var text = '# hello, markdown!';
var html = converter.makeHtml(text);
New contributor
kyleplo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Hello thanks for you're answer, the library is pretty cool but it's not adapted to my problem. In fact this library is maybe too restrictive...
– Fanny Bellais
Dec 27 at 16:51
the values to change are to restrictive, exemple for the library : # heading and in my case : h1. heading
– Fanny Bellais
Dec 27 at 16:53
add a comment |
It might be better if you use a Markdown to HTML converter. I recommend ShowdownJS. Just add it to your project with <script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.0/showdown.min.js"></script>
, and then use this code:
var converter = new showdown.Converter();
var text = '# hello, markdown!';
var html = converter.makeHtml(text);
New contributor
kyleplo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
It might be better if you use a Markdown to HTML converter. I recommend ShowdownJS. Just add it to your project with <script src="https://cdnjs.cloudflare.com/ajax/libs/showdown/1.9.0/showdown.min.js"></script>
, and then use this code:
var converter = new showdown.Converter();
var text = '# hello, markdown!';
var html = converter.makeHtml(text);
New contributor
kyleplo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
kyleplo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
answered Dec 27 at 13:39
kyleplo
305
305
New contributor
kyleplo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
New contributor
kyleplo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
kyleplo is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Hello thanks for you're answer, the library is pretty cool but it's not adapted to my problem. In fact this library is maybe too restrictive...
– Fanny Bellais
Dec 27 at 16:51
the values to change are to restrictive, exemple for the library : # heading and in my case : h1. heading
– Fanny Bellais
Dec 27 at 16:53
add a comment |
Hello thanks for you're answer, the library is pretty cool but it's not adapted to my problem. In fact this library is maybe too restrictive...
– Fanny Bellais
Dec 27 at 16:51
the values to change are to restrictive, exemple for the library : # heading and in my case : h1. heading
– Fanny Bellais
Dec 27 at 16:53
Hello thanks for you're answer, the library is pretty cool but it's not adapted to my problem. In fact this library is maybe too restrictive...
– Fanny Bellais
Dec 27 at 16:51
Hello thanks for you're answer, the library is pretty cool but it's not adapted to my problem. In fact this library is maybe too restrictive...
– Fanny Bellais
Dec 27 at 16:51
the values to change are to restrictive, exemple for the library : # heading and in my case : h1. heading
– Fanny Bellais
Dec 27 at 16:53
the values to change are to restrictive, exemple for the library : # heading and in my case : h1. heading
– Fanny Bellais
Dec 27 at 16:53
add a comment |
Fanny Bellais is a new contributor. Be nice, and check out our Code of Conduct.
Fanny Bellais is a new contributor. Be nice, and check out our Code of Conduct.
Fanny Bellais is a new contributor. Be nice, and check out our Code of Conduct.
Fanny Bellais is a new contributor. Be nice, and check out our Code of Conduct.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Some of your past answers have not been well-received, and you're in danger of being blocked from answering.
Please pay close attention to the following guidance:
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53945888%2fmarkdown-to-html-javascript%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1k79,2I,eg2TiG,QIjT088PBJ2TYpF68L7JG1KQ s3