Link Checker Transformer not stripping html for JavaScript load | Community
Skip to main content
October 16, 2015
Solved

Link Checker Transformer not stripping html for JavaScript load

  • October 16, 2015
  • 3 replies
  • 1274 views

I have the Link Checker Transformer service turned on and the strip html extension option checked in the felix console. It is working as intended except in the following scenario.

I have an unordered list on a page:

<ul><li>Click Here</li></ul>

On clicking "Click Here", an event is triggered that redirects to another URL: /content/mysite/testpage.html using 

jQuery(location).attr('href', "/content/mysite/testpage.html");

In this case, the .html is still dangling around in the URL even after testpage has loaded.

PS: removing ".html" at the end of the URL string cannot be a solution in my case because it will fail in the author mode.

Any help in working with this issue is appreciated. Thanks!

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by JustinEd3

That makes slightly more sense. You're best bet here is to do something like:

<ul><li data-link="/content/foo.html">Click Here</li></ul>

and then configure the transformer to rewrite data-link (or whatever name) attributes of the li element, just like the href attribute of the a element.

But really, you should just do:

<ul><li><a href="https://forums.adobe.com/content/foo.html">Click Here</a></li></ul>

I'm assuming there's some good reason you can't do this.

3 replies

Adobe Employee
October 16, 2015

JavaScript content is not rewritten by any of the default rewriter pipeline components.

I'm honestly unclear on what you're trying to accomplish. It seems like you're just using JavaScript to do the same thing that clicking the link would do. Perhaps if you explain what you're trying to accomplish, someone could provide suggestions on how to move forward.

October 16, 2015

I have edited my question. There is no anchor tag now. It is a list element. I want to have clean URL's without any .html extensions.

JustinEd3Adobe EmployeeAccepted solution
Adobe Employee
October 16, 2015

That makes slightly more sense. You're best bet here is to do something like:

<ul><li data-link="/content/foo.html">Click Here</li></ul>

and then configure the transformer to rewrite data-link (or whatever name) attributes of the li element, just like the href attribute of the a element.

But really, you should just do:

<ul><li><a href="https://forums.adobe.com/content/foo.html">Click Here</a></li></ul>

I'm assuming there's some good reason you can't do this.