[
https://issues.apache.org/jira/browse/KNOX-763?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15671032#comment-15671032
]
Sumit Gupta commented on KNOX-763:
----------------------------------
I've added a new function $import that adds the @import tag as well as provides
the ability to add a prefix so that quotes or whatever else is needed can be
added. Please see the test case for exact usage.
This is solution is far from ideal but the way the rewrite framework is being
leveraged for rewriting html pages needs revisiting. There are two issues that
I found worth mentioning:
1. The 'path' construct is limiting for rewriting text content of an html tag
as it could contain more than path information
2. The functions are expected to be at the start of a token (rewrite
terminology) and also therefore the resolved value is expected to replace the
entirety of the segment. One potential fix was to allow for functions to be
placed anywhere in a token and the resolved value to replace the function
portion of a segment but that required a lot of change to the rewrite base
constructs. This probably simply highlights point 1.
> Rewrite rules for importing stylesheets using @import
> -----------------------------------------------------
>
> Key: KNOX-763
> URL: https://issues.apache.org/jira/browse/KNOX-763
> Project: Apache Knox
> Issue Type: Bug
> Reporter: Nishant Bangarwa
> Assignee: Sumit Gupta
> Fix For: 0.11.0
>
> Attachments: rewrite-test.patch
>
>
> If a stylesheet is imported by using @import rewrite rules fail to rewrite
> the correct URL.
> A failing unit test is attached.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)