fix: improve wiki link detection and file type check
- Fix file type check logic (change '!file?.extension === md' to 'file?.extension !== md')
- Improve wiki link detection to work with links anywhere in the line (not just at line end)
- Optimize check order for better code organization