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

Fails to remove html tag #170

Open
Vagelis-Prokopiou opened this issue Oct 20, 2022 · 7 comments
Open

Fails to remove html tag #170

Vagelis-Prokopiou opened this issue Oct 20, 2022 · 7 comments
Assignees
Labels
C-bug Category: Something isn't working P-windows Platform: Windows

Comments

@Vagelis-Prokopiou
Copy link

Vagelis-Prokopiou commented Oct 20, 2022

The following fail:

sd '</span>' '' file.txt
sd -s '</span>' '' file.txt

The respective sed command works:

 sed 's|</span>||g' file.txt

Platform: Windows
sd version: 0.7.6
Executed from within Git Bash.

PS: I also tried various combinations with escaping the special characters, but nothing worked.

@CosmicHorrorDev
Copy link
Collaborator

I'm not able to repro this with v0.7.6 on Linux. Let me know if you're still able to reproduce this and if other replacements also fail

image

@Vagelis-Prokopiou
Copy link
Author

Vagelis-Prokopiou commented May 11, 2023

Hi @CosmicHorrorDev.
Yes. Still reproducible (sd 0.7.6).

As I said, this is reproducible on Windows, through Git Bash.

The following do not work.

echo -n '<span>Hi</span>' | sd '</span>' ''
echo -n '<span>Hi</span>' | sd -s '</span>' ''
echo -n '////' | sd '/' ''

The following work:

echo -n '<span>Hi</span>' | sed 's|</span>||'
echo -n '////' | sed 's|/||g'

See the image:
image

@CosmicHorrorDev
Copy link
Collaborator

Thanks for verifying!

I'll try to get windows with git bash setup, so that I can dig in more

@CosmicHorrorDev CosmicHorrorDev self-assigned this May 11, 2023
@Vagelis-Prokopiou
Copy link
Author

I have an intuition that it may be related to the / character.
This character has also given me problems with other tools too (see BurntSushi/ripgrep#1973).
The questions though is, why do sed and grep work, whereas sd and rg don't?
It is interesting.

@CosmicHorrorDev CosmicHorrorDev added C-bug Category: Something isn't working M-needs triage Meta: Maintainer label me! labels May 17, 2023
@CosmicHorrorDev CosmicHorrorDev added this to the v0.8.0 Release milestone May 17, 2023
@dev-ardi
Copy link
Contributor

dev-ardi commented Oct 20, 2023

for some reason /foo expands to "C:/Users/user/AppData/Local/Programs/Git/foo". This is some weird git bash behaviour, might be a clap bug.

@CosmicHorrorDev
Copy link
Collaborator

There's a lot more discussion on this in #208

@dev-ardi
Copy link
Contributor

dev-ardi commented Oct 22, 2023

export MSYS_NO_PATHCONV=1 solves it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: Something isn't working P-windows Platform: Windows
Projects
None yet
Development

No branches or pull requests

3 participants