Attachment hyperlink modify question

Dear all,
I would like to edit attachments-table.vm at the path * <Confluence_Install>/confluence/pages/includes/attachments-table.vm, to control file type extension hyperlink. When file type is png or xlsx, it can be downloaded, others can not be download. My modify content is as below. But it can not work.

Here is my test result