removed unused markdown handle

This commit is contained in:
u-e 2018-12-29 12:52:30 +03:00
parent 7f30469318
commit 4b09cc2740

View File

@ -21,7 +21,7 @@ const urlRegex = /(http|ftp|https):\/\/([\w_-]+(?:(?:\.[\w_-]+)+))([\w.,@?^=%&:/
const aTagRegex = /(<\s*a[^>]*>(.*?)<\s*[/]\s*a>)/g;
const imgTagRegex = /(<img[^>]*>)/g;
const iframeRegex = /(?:<iframe[^>]*)(?:(?:\/>)|(?:>.*?<\/iframe>))/g;
const codeTagRegex= /(?:<code[^>]*)(?:(?:\/>)|(?:>.*?<\/code>))/g;
//const codeTagRegex= /(?:<code[^>]*)(?:(?:\/>)|(?:>.*?<\/code>))/g;
export const markDown2Html = (input) => {
if (!input) {
@ -69,9 +69,9 @@ export const markDown2Html = (input) => {
output = handleIframe(output);
}
if (codeTagRegex.test(output)) {
output = handleCodeTag(output);
}
// if (codeTagRegex.test(output)) {
// output = handleCodeTag(output);
// }
if (linkRegex.test(output)) {
output = handleLinks(output);
@ -159,17 +159,17 @@ const changeMarkdownImage = input => input.replace(markdownImageRegex, (link) =>
const centerStyling = input => input.replace(centerRegex, () => '<center style="text-align:center;">');
const handleCodeTag = input => input.replace(codeTagRegex, (tag) => {
const stringsRegex = /(?<=>)(.*)(?=<)/g;
const match = tag.match(stringsRegex);
// const handleCodeTag = input => input.replace(codeTagRegex, (tag) => {
// const stringsRegex = /(?<=>)(.*)(?=<)/g;
// const match = tag.match(stringsRegex);
if (match && match[0]) {
return `<p class="code" >${match[0]}</p>`;
}
// if (match && match[0]) {
// return `<p class="code" >${match[0]}</p>`;
// }
return iframeBody(match[0]);
// return iframeBody(match[0]);
});
// });
const createCenterImage = input => input.replace(imgCenterRegex, (link) => {
let _link = link;