diff --git a/src/components/Article.js b/src/components/Article.js index 4fa9c40..6b32443 100644 --- a/src/components/Article.js +++ b/src/components/Article.js @@ -8,19 +8,16 @@ const Article = ({article}) => { let type = []; let ind = 0; let tick=false; - let delimiters = ['', '`', '*']; + let delimiters = ['', '`', '*', '~']; for (let i = 0; i < text.length; i++) { // Iterate through input - console.log(text[i]); if (delimiters.indexOf(text[i]) !== -1) { // Detect Code Delimiter if (tick) { // Close the code section - console.log(1); output[++ind] = "" tick = false; } else { // Start a new code section - console.log(2); type.push(delimiters.indexOf(text[i])); if (!output[ind]) { @@ -44,16 +41,12 @@ const Article = ({article}) => { } - console.log(3); output[ind] += text[i] } } - console.log(output); - console.log(type); - return [...output.keys()].map((i)=>{ // Format text and return as jsx @@ -69,7 +62,12 @@ const Article = ({article}) => { return
{output[i]}
; - }else { + } else if (type[i] === 3) { + + return
  • {output[i]}
  • ; + + + } else { return
    ; } }); diff --git a/src/components/css/Articles.css b/src/components/css/Articles.css index ca63e41..67d3742 100644 --- a/src/components/css/Articles.css +++ b/src/components/css/Articles.css @@ -23,4 +23,8 @@ font-weight:bolder; margin-top: 10px; margin-bottom: 10px; +} + +.article .li { + margin-left: 10px; } \ No newline at end of file