Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add initial support for Markdown #7

Merged
merged 3 commits into from
Sep 24, 2022
Merged

Conversation

a-parris21
Copy link

Fixes #6

  • Added code so the tool can read .md files
  • Added parsing for # header1 and ## header2 syntax features.
  • Fixed a minor issue on lines 45 and 54 in index.js, regarding a value comparison and variable names, as discussed on Slack/Discord.

Description

In your writeFile function, I have added a few lines which, when parsing the data, will check if the line begins with a '#' character. If the line starts with '# ' or '## ' followed by other text, a substring of that line will be made (truncating the first few characters which act as the identifier for the header syntax feature). And the substring will be used to add an <h1> or <h2> element to the html string.
This way, if a line begins with the appropriate syntax, then instead of generating a <p> element, an <h1> or <h2> element will be generated instead.

@netlify
Copy link

netlify bot commented Sep 24, 2022

Deploy Preview for gregarious-brigadeiros-a2c383 ready!

Name Link
🔨 Latest commit c40b9a4
🔍 Latest deploy log https://app.netlify.com/sites/gregarious-brigadeiros-a2c383/deploys/632e64d3777fe20009cd8218
😎 Deploy Preview https://deploy-preview-7--gregarious-brigadeiros-a2c383.netlify.app/dist
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@a-parris21 a-parris21 changed the title Issue-6 Add initial support for Markdown Sep 24, 2022
@anshul137 anshul137 merged commit e89fa7e into anshul137:main Sep 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Addition of initial Markdown support
2 participants