FuzzyFilePath icon indicating copy to clipboard operation
FuzzyFilePath copied to clipboard

Image Sourcing Bug

Open touhid-rahman opened this issue 7 years ago • 1 comments

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!

touhid-rahman avatar Dec 25 '17 20:12 touhid-rahman

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 avatar Jan 01 '18 14:01 sagold