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

Markdown support #12

Merged
merged 5 commits into from Sep 24, 2021
Merged

Markdown support #12

merged 5 commits into from Sep 24, 2021

Conversation

TueeNguyen
Copy link
Contributor

@TueeNguyen TueeNguyen commented Sep 22, 2021

This patch fixes #4

It supports correctly formatted markdown files with bold, italic, heading and link.

Refactor code by adding a function writeHtmlFile(title, body, file, fileType

@menghif
Copy link
Owner

menghif commented Sep 23, 2021

Thank you Tue, This looks great!
One thing I noticed is that it only works with Markdown files when a directory is selected as input. It does not work when a Markdown file is selected as input.

You just need to add a line similar to the one that looks for .txt files:

if (fs.statSync(argv.input).isFile() && argv.input.match(/.txt$/)) {
    files[0] = argv.input;
  }

You can also update the README to mention that the program now works with Markdown files and you can remove textfiles/text.md from the commit (I will add an example myself to the examples branch)

@menghif menghif merged commit 92c633b into menghif:main Sep 24, 2021
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.

Implementing support for Markdown
2 participants