Skip to content

Commit

Permalink
fix bug #3
Browse files Browse the repository at this point in the history
  • Loading branch information
DarioWunsch committed May 10, 2011
1 parent 34ba014 commit 55e58b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tag-main/src/com/granule/utils/PathUtils.java
Expand Up @@ -128,7 +128,7 @@ public static String getRelpath(String target, String base) {
}

public static boolean isWebAddress(String path) {
return path.startsWith("http://") || path.startsWith("https://");
return path.startsWith("http://") || path.startsWith("https://") || path.startsWith("//");
}

public static boolean isValidJs(String path) {
Expand Down

1 comment on commit 55e58b5

@ilychakov
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To fix the problem with overwriting absolute path in CSS

E.g. /css/buttons.css contains
.span {background url(/image/blah.png)}
The line should stay same, but during conversion it's changed to .span {background url(/css/image/blah.png)}

Steps to fix:

  1. revert current change
  2. Replaces lines in com/granule/utils/CSSHandler.java
    from
                if (!replaceInfo.isImport)
                    sb.append(PathUtils.clean(newPath + replaceInfo.text));

to

                if (!replaceInfo.isImport) {
                    sb.append(PathUtils.clean((replaceInfo.text.startsWith("/") ? "" : newPath) + replaceInfo.text));
                }

Thanks!

Please sign in to comment.