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

Inline tags strips newline outside of tags #28

Open
weinis opened this issue Sep 28, 2022 · 3 comments
Open

Inline tags strips newline outside of tags #28

weinis opened this issue Sep 28, 2022 · 3 comments

Comments

@weinis
Copy link

weinis commented Sep 28, 2022

When attempting to strip a portion of a line using inline tagging, the newline is also stripped. This happens even if trailing white space is added at the end of the line

Example:

const var1 = "123"
const var2 /*begin_strip_tag*/ = "This is a string I want removed" /*end_strip_tag*/

will result in:

const var1 = "123"const var2

I would expect:

const var1 = "123"
const var2 
@weinis weinis changed the title Inline tags blocks remove newline Inline tags strips newline outside of tags Sep 28, 2022
@nuzzio
Copy link
Owner

nuzzio commented Feb 20, 2024

Hi @weinis, thank you for submitting this and my apologies for the (super) late reply. Regarding the end of line issue:

The task is currently using grunt.util.linefeed which basically "sets the linefeed character, normalized for the current operating system. (\r\n on Windows, \n otherwise). "

It is supposed to take into account the current linefeed and build replace blocks with it. The fact that it is not happening on your side makes me wonder what encoding and linefeed chars your code is using and what machine type (OS/version) is running the task. Would be able to provide some detail on this?

@weinis
Copy link
Author

weinis commented Feb 20, 2024

Centos7

Running cat -e filename.js the linefeeds show up as $, which represent \n

file -i filename.js yields text/plain; charset=us-ascii

@nuzzio
Copy link
Owner

nuzzio commented Feb 20, 2024

Thank you. It does not look like I ever implemented the options.eol yet. I wonder if you can:

  1. Set grunt.util.linefeed = '\n'; in your grunt file and see if there is any change in behavior.

If that does not work, would you:

  1. Check the localectl status output and paste it here.
  2. Create a small file that has the same issue and upload it here. I will try to recreate the problem and investigate it.

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

2 participants