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

Remove initial line feed plugin + php component = bad line numbering #935

Closed
rzvc opened this issue Apr 20, 2016 · 2 comments
Closed

Remove initial line feed plugin + php component = bad line numbering #935

rzvc opened this issue Apr 20, 2016 · 2 comments

Comments

@rzvc
Copy link

rzvc commented Apr 20, 2016

The "remove initial line feed" plugin gets triggered on "before-highlight" and changes env.code (removes the redundant initial line feed).

The php component has a hook on "before-insert", which restores env.code to env.backupCode.

The line numbering plugin gets triggered on "complete" and uses env.code to figure out how many lines there are so it counts an extra line.

Possible fix (works fine for me): env.backupCode = env.code; in the Remove Initial Line Feed plugin.

@LeaVerou
Copy link
Member

@Golmote @zeitgeist87 Why do we have a remove initial line feed plugin? Isn't this covered by the whitespace normalizer?

@zeitgeist87
Copy link
Collaborator

@Golmote @zeitgeist87 Why do we have a remove initial line feed plugin? Isn't this covered by the whitespace normalizer?

The remove initial line feed plugin is deprecated. It says so in all caps on its page. We could remove it in the next release.

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

No branches or pull requests

3 participants