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

Image Sourcing Bug #48

Open
touhid-rahman opened this issue Dec 25, 2017 · 1 comment
Open

Image Sourcing Bug #48

touhid-rahman opened this issue Dec 25, 2017 · 1 comment
Labels

Comments

@touhid-rahman
Copy link

It's putting a "" sign before which is not needed and so image source is not working.

It should be:
<img src="img/logo _2.png"

It is giving:
<img src="/img/logo _2.png"
http://prntscr.com/hs6pa6

Please suggest ways so I can fix this; thanks!

@sagold
Copy link
Owner

sagold commented Jan 1, 2018

Hi touhid-rahman.

Absolute filepaths have a leading slash per default. The most straightforward is to add an regex (replace_on_insert) to your custom trigger, like the following

{
    "scope": "text\\.html",
    "prefix": ["src", "url"],

    "auto": true,
    "base_directory": true,
    "extensions": ["js", "png", "gif", "jpeg", "jpg", "svg"],
    "relative": true,
    "replace_on_insert": [
    	["^\\\/", ""]
    ]
}

If you have not yet added the rules to your custom settings, i suggest you copy your required triggers to your FuzzyFilePath UserSettings and modify the corresponding config.

@sagold sagold added the Question label Jan 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants