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

adds remove-final-line-feed plugin #843

Closed
wants to merge 1 commit into from

Conversation

cmcculloh-kr
Copy link

Add plugin to remove final blank line.

@zeitgeist87
Copy link
Collaborator

Thanks for the PR. It seems like you've included the file components/prism-jsx.min.js by accident.

I don't know if this was discussed already somewhere, but I find the plugin remove-initial-line-feed and remove-final-line-feed quite odd. Why don't we just create a simple trim plugin that does both? The user could add the class no-left-trim and no-right-trim to disable the respective trim operation. @Golmote Is there a particular reason why the plugin remove-initial-line-feed removes only a single line feed and not all leading whitespace?

@cmcculloh-kr
Copy link
Author

I'd love to see remove-initial-line-feed remove all leading whitespace as well.

And, yeah, a simple trim plugin that does both would probably be better, but, remove-initial already existed, so...

@LeaVerou
Copy link
Member

Thanks for contributing @CormacMcCarthy!
Don't we have a general plugin for whitespace removal? If not, we should. We can't have one plugin for extra indent removal, one for last line, one for first line etc, it’s getting ridiculous. We can always allow options (not on the element, as these options are likely intended to be global).

@zeitgeist87
Copy link
Collaborator

Don't we have a general plugin for whitespace removal?

I don't think so. There is only the remove-initial-line-feed plugin, which removes exactly one line from the start.

@cmcculloh-kr
Copy link
Author

@LeaVerou if you know of such a plugin, please let me know! I'm about to write one for extra indent removal today if I can't find it, because that's the next thing I need. I agree it would totally be better for them all to be the same plugin. If I write one that does extra indent removal, I'll just throw the trim stuff in there as well to consolidate it all down to one.

@zeitgeist87
Copy link
Collaborator

@CormacMcCarthy I have just submitted a PR #847 with a general purpose whitespace plugin, that also does extra indent removal, but it needs more testing and I probably have to change the way it gets its global configuration, since that is a new feature to Prism and subject to change.

@cmcculloh-kr
Copy link
Author

Nice, thanks! OK, I'll pull that into my project to help test. I'll comment on #847 with findings.

@Golmote
Copy link
Contributor

Golmote commented Jul 3, 2016

As PR #847 was merged, I'm closing this PR.

@Golmote Golmote closed this Jul 3, 2016
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.

4 participants