-
Notifications
You must be signed in to change notification settings - Fork 124
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
Refactor markdown-engine.ts by extracting custom markdown features into separate files #34
Conversation
…to separate files
I moved custom markdown features such as code fencing into separate files, which reduced the size of I've been using atom-beautify on file save, so some spacing has changed too. I'll be great to use similar coding style in future – I'm happy to reconfigure mine if you have a preference! |
|
||
export default (md: MarkdownIt, config: MarkdownEngineConfig) => { | ||
// @ts-ignore | ||
md.inline.ruler.before('strikethrough', 'critic-markup', (state, silent) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@shd101wyy could you please explain why this function returns boolean? According to a type definition in @types/markdown-it it is expected to return void. I had to add // @ts-ignore
in several feature files to ignore build errors meanwhile. Is there any place in mume or markdown-it that is using the returned true / false? I could not find it.
bc2afb7
to
5180cac
Compare
I've been using prettier Prettier in several javascript projects and quite enjoyed the way it enforces order in all the code. It turned out that prettier began to support typescript a few months back, so I added it to this PR. Two new commits add Prettier together to tslint, which is a helpful tool to spot imperfections that prettier cannot fix automatically. With these two new dependencies, an editor (Atom in my case) becomes much more responsive as the new code gets written. The more errors and warnings "as you go", the fewer errors in runtime and the easier it is to collaborate due to a community-enforced code standard. @shd101wyy I'll be happy to help you with setting up prettier and tslint if you're new to these tools. |
c2cfa6b
to
75422e0
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just merged shd101wyy/master
branch to the branch of this pull request. Everything looks good to me. You can merge it whenever you want. Then I will go publish a new release. Thank you very much ;)
Great to hear that @shd101wyy! Will you be happy if I simply press "merge pull request" or do you expect me to rebase etc.? |
@kachkaev I think simply "merge pull request" is good enough. Thanks. |
Done! Looking forward to send more PRs after the new release! Just holding on for now to avoid too much complexity in the git tree :–) |
In response to #33