Skip to content

fixed man issue with #

Jensen Li requested to merge definitiveabove/slithering-duck:man_patch into master

"#" creates a html anchor (which means the rest of the query is "disregarded", leading us to effectively go to https://linux.die.net/man/1/ for the url when pasted in). The url cannot be clicked on in Discord because of the % symbol - it looks like Discord will refuse to open URL links if they appear to be malformed (in this case the stuff that is directly after % isn't a valid percent-encoded character).

Fixed by making sure that we aren't on section pages, but I'm not sure if this is the best fix - using "!man ls#%" leads to "https://linux.die.net/man/1/ls#%" which is still valid but is a malformed URL that Discord refuses to open (oddly enough, you can open the preview of the link on Discord fine) - perhaps the best solution is to sanitize input and remove # and % from content before checking man pages?

I also updated the error message for searching by section to better reflect to the user that they are searching in a section (the original returned statement makes it look like the program searched exactly '

' rather than in
)

Fixes #47 (closed)

Edited by Jensen Li

Merge request reports

Loading