Skip to content
This repository has been archived by the owner on Jan 3, 2023. It is now read-only.

Correct instantiation conditions for markdown-it #92

Merged
merged 1 commit into from
Sep 3, 2015

Conversation

Galadirith
Copy link
Collaborator

@leipert While I was twiddling away with #88 I noticed that markdown-it seems to still be being instanced for every edit of the source. It looks like a couple of the conditions weren't working:

  1. Javascript doesn't seem to handle comparing objects so markdownItOptions isnt getOptions() was always returning true. I replaced this with L49 as the only variable in the options is markdown-preview-plus.breakOnSingleNewline.
  2. markdownIt? is false if markdownIt === null || markdownIt === undefined which is exactly the opposite of what we want.

I'm not sure if this really gives any perceived performance benefit, but not instancing every parse must be at least a little bit better :D

@Galadirith Galadirith added this to the 2.0.1 milestone Sep 2, 2015
@Galadirith Galadirith added the bug label Sep 2, 2015
@Galadirith Galadirith mentioned this pull request Sep 3, 2015
24 tasks
@leipert
Copy link
Contributor

leipert commented Sep 3, 2015

@Galadirith Looks fine to me. Thanks for catching this 👍

Just merge, if this is production ready ;)

Galadirith added a commit that referenced this pull request Sep 3, 2015
Correct instantiation conditions for markdown-it
@Galadirith Galadirith merged commit f0264af into master Sep 3, 2015
@Galadirith Galadirith deleted the fix/markdown-it-instantiation branch September 3, 2015 10:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants