Skip to content
This repository was archived by the owner on Apr 2, 2025. It is now read-only.

Fix Manganato search#218

Open
joao-salomao wants to merge 1 commit intometafates:mainfrom
joao-salomao:bugfix/manganato-query-string
Open

Fix Manganato search#218
joao-salomao wants to merge 1 commit intometafates:mainfrom
joao-salomao:bugfix/manganato-query-string

Conversation

@joao-salomao
Copy link

This PR fixes two bugs.

  1. Wrong base URL template
    Wrong: https://chapmanganato.com/https://manganato.com/search/story/%s
    Correct: https://manganato.com/search/story/%s
  2. After digging a bit on the website I found that the JS function below is being used to parse the user searches before sending the request to the server, so I implemented the same logic here too so we get the same results
function change_alias(alias) {
    var str = alias;
    str= str.toLowerCase(); 
    str= str.replace(/à|á|||ã|â||||||ă|||||/g,"a"); 
    str= str.replace(/è|é||||ê||ế|||/g,"e"); 
    str= str.replace(/ì|í|||ĩ/g,"i"); 
    str= str.replace(/ò|ó|||õ|ô||||||ơ|||||/g,"o"); 
    str= str.replace(/ù|ú|||ũ|ư|||||/g,"u"); 
    str= str.replace(/|ý|||/g,"y"); 
    str= str.replace(/đ/g,"d");
    str= str.replace(/ /g,"_");
    str= str.replace(/[^0-9a-z\s]/gi, '_');
    str= str.replace(/_+_/g,"_");
    str= str.replace(/^\_+|\_+$/g,""); 
    return str;
}

JS function location on the website
image

Telmo added a commit to Telmo/mangal that referenced this pull request Dec 19, 2024
@rd6260
Copy link

rd6260 commented Dec 21, 2024

Hey @joao-salomao I hope you're doing well. I just wanted to ask, if mangal still working? cause its not showing any results for me

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants