-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Resolves #1618, preserve the markup if it's the last element #1622
Resolves #1618, preserve the markup if it's the last element #1622
Conversation
@RunDevelopment I didn't find any tests on this plugins, is there a way to add tests ? |
@Mogztter No, plugins are not tested (at least right now). |
It seems like the current implementation of Keep Markup assumes that every tag contains at least one character, causing #1618. This PR does handle the case of the last tag correctly but it handles some other case worse than the current implementation.
Tag inclusion is probably just a symptom of #1640. Right now, this implementation does more harm than good, so we will have to address the above points before we can merge this. |
OH! we really need tests 😄 |
Of course, you can submit the proposal but it will require to implement a very different test suite than the one we have right now. So, no small task.
I don't see why that is. A little hacky but I just made a little test page based on the index page of the plugin. Insert the markup to be tested and verify yourself. Not pretty but it works. |
If we wanted to go all-out, something w/ JSDOM + snapshot tests could work. We have a (admittedly complex) mocha/chai setup for the current tests. Might be nice to get some tests going for the plugins. |
That's exactly what I had in mind 👍
|
@Mogztter I really appreciate the enthusiasm and the contribution. I think if we're going to do this (introduce testing for plugins), we should break up this PR into one that introduces the framework and maybe some basic, passing tests, then a separate PR that adds tests for & fixes this bug. That'll allow us to evaluate each of those things separately. |
@mAAdhaTTah Sure no worries. |
@Mogztter I'd prefer to evaluate the bugfix in a separate PR. It's not clear to me this comment isn't a result of introducing that change. What I'd suggest is ending up with 2 PRs:
How you want to break that up (modifying this PR to be just tests, or closing and creating them separately) is up to you, but that's the place I'd like to end up if we want to add tests at this time. The smaller the PR, the easier it will be to get each of them in, and I'd like to evaluate & think through the testing infrastructure as well as whatever tests you're introducing without also needing to evaluate the change(s) you're making to the plugin. Does that make sense? My apologies for making this complex; I threw out the suggesting not expecting you to run with it so fast. And I appreciate it, but it does ramp up the overall complexity of what you're doing, and I just want to simplify it as much as possible. |
@mAAdhaTTah Done, see #1646 |
Let's get the tests in first, then we'll get this fix. |
9495b20
to
a3c8300
Compare
a3c8300
to
b16ecae
Compare
@mAAdhaTTah Rebased 👍 |
Hey, sorry for the delay on this, but coming back to this now. I see one code change, which I guess is fine? Does this change the commented out test? We should either delete it and replace it with a test that represents the intended behavior or update it. That said, if this change removes that I'm going to go ahead & close, but happy to reopen if anything above I've said it wrong. |
No description provided.