Adding <base target="_blank"> to Knowledge Articles Not being Saved

matthorn
Kilo Explorer

I am trying to configure a knowledge article to have all the links in the article open in a new window.  Something changed recently in Chrome that is causing links in our Knowledge articles to open in a new tab instead of a new window which is why I'm seeking a solution to default all the links in certain articles to open in a new window.  In some knowledge articles we have hundreds of links so manually going into the properties for every link and setting the target from none to New Window is too time consuming.  I would also prefer a simple way to make this change on a specific article.  

I found this thread from 3 years ago which appears to be the solution but I'm having a problem getting the code change to save.  

https://community.servicenow.com/community?id=community_question&sys_id=93629b61db101fc01dcaf3231f9619f1

When I open the knowledge article I want to edit, I click the source code button and insert the following line to the top of the article. This is the very first line in the HTML code and I'm not making any other changes to existing lines.

<p><base target="_blank"></p>

I then click OK to save the change and go back into the source code again to confirm but the line is replaced with the following. 

<p>&nbsp;</p>

At first I thought it was the HTML Sanitizer causing the problem so I disabled it by setting the system properties for glide.html.sanitize_all_fields and glide.translated_html.sanitize_all_fields to false for testing and it still does the same thing. 

We are on Jakarta Patch 3.  

Thanks in advance for any help the community can provide. 

Matt

7 REPLIES 7

Gurpreet07
Mega Sage

Try to whitelist base tag along and target attribute

https://docs.servicenow.com/bundle/jakarta-platform-administration/page/administer/security/concept/c_HTMLSanitizer.html

Thanks for the suggestion Gurpreet. I didn't try doing the whitelist.  I just disabled the HTML Sanitizer using the system property in my sub production instance.  Is there any reason I would still need to do the whitelist entries if I already disabled HTML Sanitizer? 

Not sure if its disabled because its still removing tags and attributes from the code. So you could give a try to white-list the tag n attribute

Still no luck.  Below is what the script in the HTMLSanitizerConfig Script Include.  I added the whitelist entry for the base target line.  I also noticed (before making this change) that there is a warning about a missing semicolon.  I don't know if that matters or not but I figured I'd mention that.  After adding the whitelist entry, I still get the same results.  

I'm stumped here. With the system properties set to false, the sanitizer shouldn't be running.  I think I'm going to open a ticket up with HI next but if there are any other suggestions based on this additional info, I appreciate it. 

find_real_file.png