Esempio n. 1
0
        private static String rewriteLink(Token token, Uri _base, ILinkRewriter rewriter)
        {
            Match matcher = urlMatcher.Match(token.toString());

            if (!matcher.Success)
            {
                return(token.toString());
            }

            return("url(\"" + rewriter.rewrite(matcher.Groups[2].Value.Trim(), _base) + "\")");
        }
Esempio n. 2
0
        public void accept(Token token,
                           Token lastToken)
        {
            if (token.type == HtmlTokenType.TAGBEGIN)
            {
                tagAttributeTargets.TryGetValue(token.toString().Substring(1).ToLower(), out currentTagAttrs);
            }

            if (currentTagAttrs != null &&
                lastToken != null &&
                lastToken.type == HtmlTokenType.ATTRNAME &&
                currentTagAttrs.Contains(lastToken.toString().ToLower()))
            {
                String link = stripQuotes(token.toString());
                builder.Append("=\"");
                builder.Append(linkRewriter.rewrite(link, relativeBase));
                builder.Append('\"');
                return;
            }
            builder.Append(HtmlRewriter.producePreTokenSeparator(token, lastToken));
            builder.Append(token.toString());
            builder.Append(HtmlRewriter.producePostTokenSeparator(token, lastToken));
        }
Esempio n. 3
0
        private static String rewriteLink(Token token, Uri _base, ILinkRewriter rewriter)
        {
            Match matcher = urlMatcher.Match(token.toString());
            if (!matcher.Success)
                return token.toString();

            return "url(\"" + rewriter.rewrite(matcher.Groups[2].Value.Trim(), _base) + "\")";
        }